<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>投被保人信息</title>
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link href="../css/mui.min.css" rel="stylesheet" />
<link rel="stylesheet" href="../css/app.css" />
<link rel="stylesheet" href="../css/mui.picker.min.css" />
<script type="text/javascript" src="../js/occ.js"></script>
<style>
.container{
        font-size:0px;
    }
    .job_select_wrap .body{left:0;}
    .container .select{
        display: block;
		float: left; 
        position: relative;
        width:100%;
    }
   .container input{
        height:30px;
        border-radius: 3px;
        border: solid 1px #000;
        -moz-appearance: none;
        text-align: left;
        display:none;
        cursor:pointer;
    }
    .container .list{
        position: absolute;
        top:0;
        width:auto;
    }
    .container .list2{left:120px;}
    .container .list3{left:240px;}
    #province{
        width:100px;
    }
    #city{
        width:100px;
    }
    #area{
        width:100px;
    }
    .container ul{ 
        margin: 0;
        padding: 0;
        list-style: none;
        height:auto;
        line-height: 30px;
        overflow: auto;
        cursor:pointer;
        background: white;
        display: none;
        border:1px solid #e6e6e8;
        font-size: 14px;
    }
    #c1{
        width:120px;
        text-align:left;
    }
    #c1 li{
        margin:5px 15px;
    }
    #c2{
        width:120px;
        text-align:left;
    }
    #c2 li{
        margin:5px 15px;
    }
    #c3{
        width:120px;
        text-align:left;
    }
    #c3 li{
        margin:5px 15px;
    }
.mui-input-row label {
	width: 35%;
}
#career p{color:#333;}
.mui-input-row label ~input, .select_item {
	width: 65%;
}
/* .select_item{
				color: #333;
			} */
.mui-input-group:before {
	height: 0;
}

.footer_fixBtn {
	position: fixed;
	width: 100%;
	left: 0;
	bottom: 0;
	height: 50px;
}

.footer_fixBtn>div:last-child {
	background: #2667bf
}

.footer_fixBtn>div {
	height: 50px;
	width: 33.33%;
	float: left;
	background-color: #fff;
	text-align: center;
	line-height: 50px;
	color: #2667bf;
}
/* 提示信息 样式 ↓*/
.message {
	position: absolute;
	width: 20px;
	height: 20px;
	top: 10%;
	margin-top: 10px;
	right: 0;
}

.prompt {
	display: none;
	text-align: left;
	background-color: rgba(0, 0, 0, 0.7);
	padding: 20px;
	width: 300px;
	border-radius: 3px;
	right: -5px;
	color: #FFF !important;
	font-size: 13px;
	line-height: 1.4;
	z-index: 99;
}

.prompt:before {
	position: absolute;
	content: '';
	width: 0;
	height: 0;
	border: 6px solid transparent;
	border-bottom-color: rgba(0, 0, 0, 0.7);
	right: 10px;
	top: -12px;
}

.ocr {
	right: 28px;
	margin-top: 9px;
	width: 22px;
	height: 20px;
}
/* 提示信息 样式↑ */
.claim_header .item {
	width: 14.28%;
	font-size: 10px;
}

.num_border {
	border: 1px solid #2667bf;
	width: 18px;
	height: 18px;
	border-radius: 50%;
}

.mui-input-group .mui-input-row:after {
	height: 0;
}

.mui-input-group .mui-input-row {
	border-bottom: 1px dashed #2667bf;
	margin: 0 15px;
}

.mui-input-row label {
	padding: 13px 0;
}

.mui-input-row label ~input{
	padding-right: 20px;
}

.select_item {
	padding-right: 25px;
}

.select_item:after {
	color: #2667bf;
	right: 0;
}

.with_longTime .radio_ctrl {
	left: 28%;
}

.right_unit {
	color: #2667bf;
}

.mui-switch-blue.mui-active {
	border: 2px solid #2667bf;
	background-color: #2667bf;
}

.mui-input-row .mui-switch {
	margin-right: 0;
}

.mui-checkbox.mui-left label, .mui-radio.mui-left label {
	padding-left: 23px;
}

.my_head_info .head_img {
	border: none;
}

.my_head_info {
	margin: 0 0 10px 0;
	height: auto;
	padding-bottom: 10px;
	padding-top: 23px;
}

.mui-checkbox.radio_ctrl input[type=checkbox], .mui-radio.radio_ctrl input[type=radio]
	{
	left: 0;
}

#tbrsalary, #tbrheight, #tbrwidth, #bbrsalary, #bbrheight, #bbrwidth,#syrsalary{
	padding-right: 45px;
}

#ssrbili {
	padding-right: 35px;
}

#trbirday:after, #trcarddate:after {
	font-family: Muiicons;
	font-size: 24px;
	line-height: 1;
	position: absolute;
	top: 12px;
	display: inline-block;
	text-decoration: none;
	color: #2667bf;
	-webkit-font-smoothing: antialiased;
	right: 0;
	content: '';
	width: 20px;
	height: 20px;
	background: url("../images/idDate.png") no-repeat center top/100% auto;
}

#tbrcardnum:after {
	font-family: Muiicons;
	font-size: 24px;
	line-height: 1;
	position: absolute;
	top: 8px;
	display: inline-block;
	text-decoration: none;
	color: #2667bf;
	-webkit-font-smoothing: antialiased;
	right: 10px;
	content: '\e583' !important;
}

#ssyinfo, #tbrinfo {
	margin: 10px;
	border-radius: 10px;
}

.with_switch {
	border: none;
}

.mui-input-group:after {
	height: 0;
}

.mui-input-group {
	margin: 10px;
	border-radius: 10px;
	background: url('../images/my_bg.png') no-repeat center bottom #fff;
	background-size: 100% auto;
}

.mui-input-group .mui-input-row:last-child {
	border-bottom: none;
}

.mui-input-group .mui-input-row:first-child {
	border-bottom: none;
	overflow: visible;
}

.mui-checkbox {
	width: 93% !important;
}

.title img {
	margin-left: 6px;
	height: 18px !important;
	
}

.with_switch label {
	padding-left: 2px !important;
	padding-right: 90px !important;
	line-height: 22px;
}

.claim_header .item .sign {
	width: 11px;
}

.num {
	margin-left: 23px;
}

.mui-input-group .title.circle_plus {
	padding-left: 0 !important;
}

.mui-input-group .title.circle_plus:before {
	display: none !important;
}
/* #mbbrinfo .mui-input-row:nth-child(8){display:none;} */
#tbrinfo .with_longTime .radio_ctrl {
	width: 30% !important;
}

#tbrinfo .with_longTime:nth-child(11) label {
	display: none;
}

form .with_longTime:nth-child(11) .radio_ctrl {
	/* sjx 2020-01-14避免添加的受益人长期有效字段隐藏 */
	/* display: none; */
}

.sign_name_wrap {
	border-bottom: none;
}

#time_box {
	width: 100px !important;
}

.mui-popup-buttons span {
	font-weight: bold;
}
/* .mui-popup-backdrop:after{
	content:'';
	display:block;
	width:36px;
	height:36px;
	background:url('../images/cansel.png') no-repeat;
	background-size: 100% 100%;
    position: absolute;
    top: 35%;
    right: 14%;
	pointer-events: auto;
} */
#tipCode{
	display:none;
}
.input_right_icon{
	right:30px;
}
.cusinfo{display:block;width: 20px; position: absolute;width: 20px;height: 20px;top: 50%; margin-top: -10px; left:80px;}
#longtime{
	margin-top:-3px;
}
.posdeStyle{
    width: 100% !important;
    overflow-x: auto !important;
}
.tbr input[type="text"]{
	padding:0 5px!important;
}
.el-cascader-menu{min-width:100px;}
.ttbr_div_class,.relateInsured_div_class,.syposition_div_class,.ssrbili_div_class,.ssrname_div_class,.sscardtype_div_class,.ssrcardnum_div_class,.sscarddate_div_class,.ssrsex_div_class,.ssbirday_div_class,.syrcountry_div_class,.syrjob_div_class,.syrsalary_div_class,.syrmobile_div_class,.permposition_div_class{
	bottom:40px;
}
.country_div_class,.townn_div_class{
	bottom:80px;
}
.tongtbraddress_div_class{
	bottom:34px;
}
.tongbbraddress_div_class{
	top:-76px;
}
.syrloc_div_class,.syrposdetail_div_class,.syrworkUnits_div_class,.syrworkAddr_div_class,.syrworkAddrInfo_div_class{
	bottom:78px;
}
.syposition_div_class{
	display:none;
}
.syrsynposition_div_class{
	top:-42px;
}
.mui-checkbox111 {
    width: 44% !important;
    bottom:-10px;
}
.with_longTime .radio_ctrl {
    left: 28%;
    top: 0;
}

#mobileVerify {
	padding: 0px;
	font-size: 13px;
	color: RGB(254 138 60);
}
#trbmobileRemark1,#trbmobileRemark2{
	float:none;
	width:100%;
}
#salaryVerify {
	padding: 0px;
	font-size: 13px;
	color: RGB(254 138 60);
}
#trbsalaryRemark1,#trbsalaryRemark2{
	float:none;
	width:100%;
}
</style>
</head>
<body>
	<div id="app" class="mui-content" style="padding-bottom: 60px;">
		<div class="claim_header mui-clearfix">
			<div class="item active">
				<div class="num"></div>
				<div class="step_name">信息录入</div>
			</div>
			<div class="item">
				<div class="num"></div>
				<div class="step_name">保费试算</div>
			</div>
			<div class="item">
				<div class="num"></div>
				<div class="step_name">告知信息</div>
			</div>
			<div class="item">
				<div class="num"></div>
				<div class="step_name">缴费信息</div>
			</div>
			<div class="item">
				<div class="num"></div>
				<div class="step_name">信息确认</div>
			</div>
			<div class="item">
				<div class="num"></div>
				<div class="step_name">影像上传</div>
			</div>
			<div class="item">
				<div class="num sign"></div>
				<div class="step_name">签名</div>
			</div>
		</div>
		<div class="my_head_info">
			<div class="head_img">
				<img src="../images/logo2.png" />
			</div>
			<div style="font-size: 15px; margin-top: -10px;">
				<small name="name"></small> <img src="../images/my_man.png" width="12" height="12" id="sexicon" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<img src="../images/phone.png"  width="13" height="13" /> <small name="mobile">
				&nbsp;&nbsp;&nbsp;&nbsp;</small>
				<!--  <small name="khjl"> &nbsp;&nbsp;&nbsp;&nbsp;客户经理</small> -->
			</div>
			<div class="info" style="font-size: 15px;">
				<img src="../images/zyzNum.png"  width="15" height="15" /> <small name="zyCode">
				&nbsp;&nbsp;&nbsp;&nbsp;</small>
			</div>
			<div class="info" style="font-size: 15px;">
				<img src="../images/company.png" width="15" height="15"/> <small
					name="signcom"> &nbsp;&nbsp;&nbsp;&nbsp;</small>
			</div>
			<!-- <div  class="info">
		    		<small name="dizhi"> &nbsp;&nbsp;&nbsp;&nbsp;</small>
		    	</div> -->
		</div>		
		<div class="preview_img_wrap">
			<div class="inner">
				<div class="job_select_wrap">
					<div class="head">
						<div class="mui-input-row mui-search">
						<input class="zysearch" type="search" placeholder="职业搜索" name="search">
						</div>
						<button type="button" class="mui-btn  mui-btn-red" id="search">搜索</button>
					</div>
					<div class="body container">
					<div class="select one-level">
						<input type="text" id="province" name="Province"  placeholder="请选择省" readonly>
						<div class="list">
							<ul id="c1"></ul>
						</div>
					</div>
					<div class="select">
						<input type="text" id="city" name="City" placeholder="请选择市" readonly>
						<div class="list list2">
							<ul id="c2"></ul>
						</div>
					</div>
					<div class="select">
						<input type="text" id="area" name="Area" placeholder="请选择区" readonly>
						<div class="list list3">
							<ul id="c3"></ul>
						</div>
					</div>
						 <ul class="mui-table-view" id="career">

						</ul> 
					</div>
					<div class="footer">
						<div class="customer_btn1">
							<button onclick="$(this).parents('.preview_img_wrap').hide();$('.zysearch').val('');$(this).parents('.preview_img_wrap').find('#c1,#c2,#c3,#career').hide();$(this).parents('.preview_img_wrap').find('#c1').show();"
								class="mui-btn cancel mui-col-xs-6 mui-btn-red">取消</button>
						</div>
					</div>
				</div>
			</div>
		</div>

		<div class="cus_img_wrap">
			<div class="inner">
				<div class="job_select_wrap">
					<div class="head">
						<div class="mui-input-row mui-search">
							<input type="search" placeholder="客户搜索" name="searchcus">
						</div>
						<button type="button" class="mui-btn  mui-btn-red" id="searchcus">搜索</button>
					</div>
					<div class="body">
						<ul class="mui-table-view" id="cusinfo">

						</ul>
					</div>
					<div class="footer">
						<div class="customer_btn1">
							<button onclick="$(this).parents('.cus_img_wrap').hide();"
								class="mui-btn  mui-col-xs-6 mui-btn-red">取消</button>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="footer_fixBtn" style="z-index: 3;">
			<div onclick="upPage()" id="uppage"
				style="background: #2667bf; color: white;">上一步</div>
			<div onclick="returnIndex()" id="returnindex">回到首页</div>
			<div onclick="toNext()">下一步</div>
		</div>
	</div>
	<input type="hidden" id="tbrinfojson" value="${res}" />
	<div id="shuoming" style="display: none; position: fixed;; top: 0; left: 0; bottom: 0; right: 0; background-color: rgba(0, 0, 0, 0.6); z-index: 4;">
		<div id="shuomingcontent" style="position: fixed; top: 20px; -index: 4; left: 20px; height: 90%; overflow: auto; background: rgb(255, 255, 255); padding: 10px; right: 20px; z-index: 4; bottom: 20px; border: double;"></div>
	</div>
</body>
<script type="text/javascript" src="../js/mui.min.js"></script>
<script type="text/javascript" src="../js/city.data-3.js"></script>
<script type="text/javascript" src="../js/mui.picker.all.js"></script>
<script type="text/javascript" src="../js/jquery-2.1.0.js"></script>
<script type="text/javascript" src="../js/tools.js"></script>
<script src="../js/recall.js"></script>
<script type="text/javascript" src="../js/auto.js"></script>
<script type="text/javascript" src="../js/guojia.js"></script>
<script type="text/javascript" src="../js/idcardarea.js"></script>
<script type="text/javascript" src="../js/Relations.js"></script>
<!-- <script src="../js/anysign/anysignWebInterface.js"></script>
<script src="../js/anysign/anysignWeb.js"></script> -->
<script type="text/javascript" src="../js/jweixin-1.4.0.js"></script>
<script type="text/javascript" src="../js/share.js" ></script>
<script type="text/javascript" src="../js/hideTool.js" ></script>
<script type="text/javascript" src="../js/countryCNEN.js" ></script>
<script>
setupWebViewJavascriptBridge(function (bridge) {
	/* Initialize your app here 所有与iOS交互的JS代码放这里！*/
	bridge.callHandler('returnAppVerion', '', function callback(response) {
				console.log('JS got response', response);
				var appVersion = JSON.parse(response).appVersion;
				if (appVersion != null && appVersion.length > 0) {
					$.ajax({
						type: 'post',
						url: getRootPath() + "/order/updateOrdNoteAppOrd.do",
						data: {
							"orderNo": getUrlParam("orderNo")
						},
						async: true,
						success: function (msg) {
							if (JSON.parse(msg).resultCode == '1') {
								console.log("修改orderNote成功！")
							} else {
								console.log("修改orderNote失败！msg" + msg);
							}
						},
						error: function (err) {
							mui.alert("修改orderNote出错,请刷新重试" + err);
						}
					});
				}
			}
	)
})
mui('body').on('tap','a',function(){
    window.top.location.href=this.href;
});
mui.init({
  gestureConfig:{
   tap: true, //默认为true
   doubletap: true, //默认为false
   longtap: true, //默认为false
   swipe: false, //默认为true
   drag: false, //默认为true
   hold:true,//默认为false，不监听
   release:true//默认为false，不监听
  }
});

/*  localStorage.setItem("shareIn","shareIn")
localStorage.getItem("openid"); */

var agentinfo = ${agentinfo1};
var planBookInfo=${planBookInfo};
var jysflag=getUrlParam("Flag");
proCode = getUrlParam('productCode');
 storage.set("agentCode",agentinfo.agentCode);
 storage.set("agentinfo",JSON.stringify(agentinfo));
 $("small[name='name']").html(agentinfo.name);
 $("small[name='mobile']").html(agentinfo.mobile);
 $("small[name='zyCode']").html("执业证号："+agentinfo.zyCode);
 $("small[name='signcom']").html(agentinfo.manageComName);
 $("small[name='dizhi']").html(agentinfo.postalAddress);
 //console.log(agentinfo)
 if(agentinfo.sex=='1'){
	 $("#sexicon").attr("src","../images/my_woman.png");
 }


var mobileVerify='1';
function changeMobileRemark() {
    if(agentinfo.channel == '1' || agentinfo.channel == '3'){
        $('#tbrmobile').attr("onblur","verify(this);");
    }

    $('#trbmobileRemark1').attr('maxlength', '200');
    $('#trbmobileRemark1').parent().find('label').css('float', 'none');
    $('#trbmobileRemark1').parent().find('label').css('display', 'block');
    $('#trbmobileRemark1').parent().find('label').css('width', 'auto');

    $('#trbmobileRemark2').attr('maxlength', '200');
    $('#trbmobileRemark2').parent().find('label').css('float', 'none');
    $('#trbmobileRemark2').parent().find('label').css('display', 'block');
    $('#trbmobileRemark2').parent().find('label').css('width', 'auto');
}
function verify(mobileInp){
    // var tcardtype=$('#trcardtype').attr('value');
    // if(tcardtype == '1'){
        var mobile =$(mobileInp).val();
        if(mobile){
            if(!isPhoneNo(mobile)){
                mui.alert('请输入正确的手机号');
                $(mobileInp).val('');
                return false;
            }

            var tbrName=$('#tbrname').val();
            if(!tbrName){
                mui.alert('请先输入投保人姓名');
                $(mobileInp).val('');
                return false;
            }
            var tbrCardNum=$('#tbrcardnum').val();
            if(!tbrCardNum){
                mui.alert('请先输入投保人证件号');
                $(mobileInp).val('');
                return false;
            }

            // 检验实名手机号
            $.ajax({
                type:'post',
                url: getRootPath()+"/order/mobileVerify.do",
                data: {
                    "name":tbrName,
                    "mobile":mobile,
                    'cerNo':tbrCardNum
                },
                success:function(msg){
                    hideLoad();
                    if(JSON.parse(msg).resultCode == '1'){
                        mobileVerify='1';
                        hideMobileRemark();
                    }else{
                        mobileVerify='0';
                        showMobileRemark();
                    }
                }
            });
        // }else{
        //     mobileVerify='1';
        //     hideMobileRemark();
        // }
    }


}
function isPhoneNo(phone) {
    var pattern = /^1[3456789]\d{9}$/;
    return pattern.test(phone);
}

function showMobileRemark() {
    $('#mobileVerify').parent().show();
    $('#trbmobileRemark1').parent().show();
    $('#trbmobileRemark2').parent().show();
}

function hideMobileRemark() {
    $('#mobileVerify').parent().hide();
    $('#trbmobileRemark1').parent().hide();
    $('#trbmobileRemark2').parent().hide();
}

//职业及年收入校验
var salaryVerify = '1';
function changeSalaryRemark() {
	//投保人职业
	var tbrjob = $('#tbrjob').attr('value');
	//投保人年收入
	var tbrsalary = $('#tbrsalary').val();
	salaryCheck(tbrjob,tbrsalary);
	$('#trbsalaryRemark1').attr('maxlength', '500');
	$('#trbsalaryRemark1').parent().find('label').css('float', 'none');
	$('#trbsalaryRemark1').parent().find('label').css('display', 'block');
	$('#trbsalaryRemark1').parent().find('label').css('width', 'auto');
	$('#trbsalaryRemark2').attr('maxlength', '500');
	$('#trbsalaryRemark2').parent().find('label').css('float', 'none');
	$('#trbsalaryRemark2').parent().find('label').css('display', 'block');
	$('#trbsalaryRemark2').parent().find('label').css('width', 'auto');
}
function showSalaryRemark() {
	$('#salaryVerify').parent().show();
	$('#trbsalaryRemark1').parent().show();
	$('#trbsalaryRemark2').parent().show();
}
function hideSalaryRemark() {
	$('#salaryVerify').parent().hide();
	$('#trbsalaryRemark1').parent().hide();
	$('#trbsalaryRemark2').parent().hide();
}
function salaryCheck(tbrjob, tbrsalary) {
	var jobArr = ["A00", "A01","F03","F31","F43","G38","G58","H01","H05","H09","I03","L01","L11","Q01","S01","S09","S10","S20","U01","V01","T04", "B02", "R01"];
	if (jobArr.includes(tbrjob)) {
		if (tbrsalary >= 50) {
			salaryVerify = "0";
			showSalaryRemark();
		} else {
			salaryVerify = "1";
			hideSalaryRemark();
			$('#trbsalaryRemark1').val('')
			$('#trbsalaryRemark2').val('');
		}
	} else {
		salaryVerify = "1";
		hideSalaryRemark();
		$('#trbsalaryRemark1').val('')
		$('#trbsalaryRemark2').val('');
	}
}

var jsondata=${res};
 var cusJson;
 if(isWeiXin()){
	/* $("#returnindex").hide();
	$("#uppage").hide();
	$(".footer_fixBtn div").css('width','100%'); */
}

		$(document).ready(function(){
			try {
				//console.log(jsondata);
				var objList = eval(jsondata);
				var objdiv=$(".mui-content");
				jsonToControl(objList,objdiv);
				mui('.mui-switch')['switch']();
				$("div[name='residentsType']").each(function(){
					$(this).css("width","45%");
					$(this).prev().css("width","52%");
				})

				$("div[name='isOtherSec']").each(function(){
					$(this).parent().addClass("with_switch flex_box");
				})
				var insuredlen=$(".insured_form").length;
				$(".insured_form:gt(0)").each(function(){
					$(this).find(".remove_insured_wrap").show();
					var title=$(this).find(".title").html();
					if(title.length==6){
						$(this).find(".title").html("附属"+title.substring(1,6));
					}
				})
				$(".insured_form:lt("+(insuredlen-1)+")").each(function(){
					$(this).find(".add_insured").hide();
				})


				//console.log(agentinfo.agentCom);
				/* $("div[name='workAddr']").each(function(){
					var channelNum = agentinfo.agentCom;
					console.log($(this).parent());

					if((channelNum.substring(0,3)) == "J04"){
						var dwposdetailVal = $(this).parent().parent().find("div[name='workAddr']").html();
						var posdetailStr = dwposdetailVal.split('-');
						var selectPosdetailVal = posdetailStr[0];
						var dwPosdetailInfoVal = posdetailStr[1];
						$(this).html(selectPosdetailVal);

						var ssyinfoflag0 = $(this).parent().parent()[0] == $(".ssyinfo")[0];
						var ssyinfoflag1 = $(this).parent().parent()[0] == $(".ssyinfo")[1];
						var ssyinfoflag2 = $(this).parent().parent()[0] == $(".ssyinfo")[2];
						if(ssyinfoflag0 == false && ssyinfoflag1 == false && ssyinfoflag2 == false){
							$(this).parent().parent().find("div[name='dwposdetail']").remove();
							$(this).parent().after('<div class="mui-input-row dwposdetailclass" name="dwposdetail"><label><span></span></label><input type="text" placeholder="请录入单位/学校详细地址" class="mui-text-right" data-value="dwposdetail" id="dwidposdetail" name="dwposdetail"  checkrul="/^[\\u4e00-\\u9fa5（）()]{5,30}$|^[\\dA-Za-z_（）()]{10,}$|^[\\dA-Za-z_\\u4e00-\\u9fa5（）()]{5,25}$|^[-A-Za-z_\\u4e00-\\u9fa5（）()\d]{5,30}$/" checktips="单位/学校详细地址输入有误" maxlength="20" onblur="changeposdetailText(this);"></div>');
							$(this).parent().parent().find("input[name='dwposdetail']").val(dwPosdetailInfoVal);
						}
					}else{
						var dwposdetailVal = $(this).parent().parent().find("div[name='workAddr']").html();
						var posdetailStr = dwposdetailVal.split('-');
						var selectPosdetailVal = posdetailStr[0];
						var dwPosdetailInfoVal = posdetailStr[1];
						$(this).parent().parent().find("div[name='dwposdetail']").remove();
						$(this).html(dwposdetailVal);
					}
				}) */
				$("div[name='workAddr']").each(function(){
					var channel = agentinfo.channel;
					//console.log($(this).parent());

					if(channel == "1" || channel == "2"){
						var dwposdetailVal = $(this).parent().parent().find("div[name='workAddr']").html();
						var posdetailStr = dwposdetailVal.split('   ');
						var selectPosdetailVal = posdetailStr[0];
						var dwPosdetailInfoVal = posdetailStr[1];
						$(this).html(selectPosdetailVal);

						var ssyinfoflag0 = $(this).parent().parent()[0] == $(".ssyinfo")[0];
						var ssyinfoflag1 = $(this).parent().parent()[0] == $(".ssyinfo")[1];
						var ssyinfoflag2 = $(this).parent().parent()[0] == $(".ssyinfo")[2];
						if(ssyinfoflag0 == false && ssyinfoflag1 == false && ssyinfoflag2 == false){
							$(this).parent().parent().find("div[name='dwposdetail']").remove();
							$(this).parent().after('<div class="mui-input-row dwposdetailclass" name="dwposdetail"><label><span></span></label><input type="text" placeholder="请录入单位/学校详细地址" class="mui-text-right" data-value="dwposdetail" id="dwidposdetail" name="dwposdetail"  checkrul="/^[\\u4e00-\\u9fa5（）()]{5,30}$|^[\\dA-Za-z_（）()]{10,}$|^[\\dA-Za-z_\\u4e00-\\u9fa5（）()]{5,25}$|^[-A-Za-z_\\u4e00-\\u9fa5（）()\d]{5,30}$/" checktips="单位/学校详细地址输入有误" maxlength="20" onblur="changeposdetailText(this);"></div>');
							$(this).parent().parent().find("input[name='dwposdetail']").val(dwPosdetailInfoVal == 0 ? "" : dwPosdetailInfoVal);
						}
					}else{
						var dwposdetailVal = $(this).parent().parent().find("div[name='workAddr']").html();
						var posdetailStr = dwposdetailVal.split('-');
						var selectPosdetailVal = posdetailStr[0];
						var dwPosdetailInfoVal = posdetailStr[1];
						$(this).parent().parent().find("div[name='dwposdetail']").remove();
						$(this).html(dwposdetailVal);
					}
				})

				/* 联系地址 为浙江省时回显处理*/
				$("div[name='position']").each(function(){
					var posdetail= $(this).parent().parent().find("input[name='posdetail']").val()
					//console.log(posdetail,999999999)
					 if($(this).text().indexOf("浙江省") != -1){
						var posdetailStr = posdetail.split('-');
						dtownVal = posdetailStr[0];
						dcountryVal =posdetailStr[1];
						posdetVal =posdetailStr[2];

						var oneflag = $(this).parent().parent()[0] == $(".ssyinfo")[0];
						var twoflag = $(this).parent().parent()[0] == $(".ssyinfo")[1];
						var threeflag = $(this).parent().parent()[0] == $(".ssyinfo")[2];
						if(oneflag == true || twoflag == true || threeflag == true){
							$(this).parent().parent().find("input[name='posdetail']").val(posdetVal);
							$(this).parent().after('<div class="mui-input-row dcountryside country_div_class" name="dcountryside"><label><span></span></label><input type="text" placeholder="请录入村" class="mui-text-right" data-value="countryside" id="countryside" name="countryside"  checkrul="/^[\\u4e00-\\u9fa5（）()]{1,30}$|^[\\dA-Za-z_（）()]{10,}$|^[\\dA-Za-z_\\u4e00-\\u9fa5（）()]{1,25}$|^[A-Za-z_\\u4e00-\\u9fa5（）()\\d]{1,30}$/" checktips="投保人村输入有误" maxlength="10" onblur="changeposdetailText(this);"></div>');
						    $(this).parent().after('<div class="mui-input-row dtown townn_div_class" name="dtown"><label><span></span></label><input type="text" placeholder="请录入镇" class="mui-text-right" data-value="town" id="town" name="town"  checkrul="/^[\\u4e00-\\u9fa5（）()]{1,30}$|^[\\dA-Za-z_（）()]{10,}$|^[\\dA-Za-z_\\u4e00-\\u9fa5（）()]{1,25}$|^[A-Za-z_\\u4e00-\\u9fa5（）()\\d]{1,30}$/" checktips="投保人镇输入有误" maxlength="100" onblur="changeposdetailText(this);"></div>');
						    $(this).parent().parent().find("input[name='town']").val(dtownVal);
						    $(this).parent().parent().find("input[name='countryside']").val(dcountryVal);
						}else{
							$(this).parent().parent().find("input[name='posdetail']").val(posdetVal);
							$(this).parent().after('<div class="mui-input-row dcountryside" name="dcountryside"><label><span></span></label><input type="text" placeholder="请录入村" class="mui-text-right" data-value="countryside" id="countryside" name="countryside"  checkrul="/^[\\u4e00-\\u9fa5（）()]{1,30}$|^[\\dA-Za-z_（）()]{10,}$|^[\\dA-Za-z_\\u4e00-\\u9fa5（）()]{1,25}$|^[A-Za-z_\\u4e00-\\u9fa5（）()\\d]{1,30}$/" checktips="投保人村输入有误" maxlength="10" onblur="changeposdetailText(this);"></div>');
						    $(this).parent().after('<div class="mui-input-row dtown " name="dtown"><label><span></span></label><input type="text" placeholder="请录入镇" class="mui-text-right" data-value="town" id="town" name="town"  checkrul="/^[\\u4e00-\\u9fa5（）()]{1,30}$|^[\\dA-Za-z_（）()]{10,}$|^[\\dA-Za-z_\\u4e00-\\u9fa5（）()]{1,25}$|^[A-Za-z_\\u4e00-\\u9fa5（）()\\d]{1,30}$/" checktips="投保人镇输入有误" maxlength="100" onblur="changeposdetailText(this);"></div>');
						    $(this).parent().parent().find("input[name='town']").val(dtownVal);
						    $(this).parent().parent().find("input[name='countryside']").val(dcountryVal);
						}


						/* $(this).parent().parent().find("input[name='posdetail']").val(posdetVal);
						$(this).parent().after('<div class="mui-input-row dcountryside" name="dcountryside"><label><span></span></label><input type="text" placeholder="请录入村" class="mui-text-right" data-value="countryside" id="countryside" name="countryside"  checkrul="/^[\\u4e00-\\u9fa5（）()]{1,30}$|^[\\dA-Za-z_（）()]{10,}$|^[\\dA-Za-z_\\u4e00-\\u9fa5（）()]{1,25}$|^[A-Za-z_\\u4e00-\\u9fa5（）()\\d]{1,30}$/" checktips="投保人村输入有误" maxlength="10" onblur="changeposdetailText(this);"></div>');
					    $(this).parent().after('<div class="mui-input-row dtown " name="dtown"><label><span></span></label><input type="text" placeholder="请录入镇" class="mui-text-right" data-value="town" id="town" name="town"  checkrul="/^[\\u4e00-\\u9fa5（）()]{1,30}$|^[\\dA-Za-z_（）()]{10,}$|^[\\dA-Za-z_\\u4e00-\\u9fa5（）()]{1,25}$|^[A-Za-z_\\u4e00-\\u9fa5（）()\\d]{1,30}$/" checktips="投保人镇输入有误" maxlength="100" onblur="changeposdetailText(this);"></div>');
					    $(this).parent().parent().find("input[name='town']").val(dtownVal);
					    $(this).parent().parent().find("input[name='countryside']").val(dcountryVal);  */
					    //console.log(dtownVal,dcountryVal)
					}else{
						$(this).parent().parent().find("input[name='posdetail']").val(posdetail);
					}
				})

				if($(".relationship").html()=="本人"){
					$(".insured_form").each(function(){
						$(this).hide();
						 $(this).children('.mui-input-row').find('div').val('');
						$(this).children('.mui-input-row').find('input').val('');
						$(this).children('.mui-input-row').find('#brcarddate').val('');
						$(this).children('.mui-input-row').find('#brcarddate').html('请选择日期');
						$(this).children('.mui-input-row').find('#brcarddate').removeClass('active');
						$(this).children('.mui-input-row').find('#brbirday').val('');
						$(this).children('.mui-input-row').find('#brbirday').html('请选择日期');
						$(this).children('.mui-input-row').find('#brbirday').removeClass('active');
						$(this).children('.mui-input-row').find('#bbrpermposition').val('');
						$(this).children('.mui-input-row').find('#bbrpermposition').html('请选择');
						/* $(this).children('.mui-input-row').find('#bbrpermposition').removeClass('active'); */
						$(this).children('.mui-input-row').find('#bbrloc').val('');
						$(this).children('.mui-input-row').find('#bbrloc').html('请选择省市');
						$(this).children('.mui-input-row').find('#bbrloc').removeClass('active');
						$(this).children('.mui-input-row').find('#bbrjob').val('');
						$(this).children('.mui-input-row').find('#bbrjob').html('请选择职业');
						$(this).children('.mui-input-row').find('#bbrjob').removeClass('active');
						$(this).children('.mui-input-row').find('#maritalStatus').val('');
						$(this).children('.mui-input-row').find('#maritalStatus').html('请选择');
						//$(this).children('.mui-input-row').find('#maritalStatus').removeClass('active');
					})
				}


				$("input[name='syaddress']").each(function(){
					$(this).parent().addClass("radio_ctrl mui-checkbox mui-left");
					$(this).parent().css("width","100%");
					$(this).parent().find("label").css("width","100%");
					$(this).click(function(){
						if($(this).prop("checked")==true){
							var tbrpostval=$("#tbrloc").attr("value");
							var tbrposition=$("#tbrloc").text();
							var tbrposdetail=$("#trbposdetail").val();
							if(tbrpostval==""||tbrposdetail==""){
								$(this).prop("checked",false);
								mui.alert('请填写投保人联系地址');
								return false
							}else{
								if(tbrposition.indexOf("浙江省") != -1){
									$(this).parent().parent().find("div[name='dtown']").remove();
									$(this).parent().parent().find("div[name='dcountryside']").remove();
									$(this).parent().next().after('<div class="mui-input-row country" name="dcountryside"><label><span></span></label><input type="text" placeholder="请录入村" class="mui-text-right" data-value="countryside" id="countryside" name="countryside"  checkrul="/^[\\u4e00-\\u9fa5（）()]{1,30}$|^[\\dA-Za-z（）()]{10,}$|^[\\dA-Za-z\\u4e00-\\u9fa5（）()]{1,25}$|^[A-Za-z\\u4e00-\\u9fa5（）()\d]{1,30}$/" checktips="投保人村输入有误" maxlength="10" onblur="changeposdetailText(this);"></div>');
									$(this).parent().next().after('<div class="mui-input-row townn" name="dtown"><label><span></span></label><input type="text" placeholder="请录入镇" class="mui-text-right" data-value="town" id="town" name="town"  checkrul="/^[\\u4e00-\\u9fa5（）()]{1,30}$|^[\\dA-Za-z（）()]{10,}$|^[\\dA-Za-z\\u4e00-\\u9fa5（）()]{1,25}$|^[A-Za-z\\u4e00-\\u9fa5（）()\\d]{1,30}$/" checktips="投保人镇输入有误" maxlength="10" onblur="changeposdetailText(this);"></div>');
									var town=$("#tbrinfo").find("input[name='town']").val();
									var countryside=$("#tbrinfo").find("input[name='countryside']").val();
									$(this).parent().parent().find("input[name='town']").val(town);
									$(this).parent().parent().find("input[name='countryside']").val(countryside);
								}else{
									$(this).parent().parent().find("div[name='dtown']").remove();
									$(this).parent().parent().find("div[name='dcountryside']").remove();
								}
								$("#bbrloc").addClass("active");
								$("#bbrloc").attr("value",tbrpostval);
								$("#bbrloc").text(tbrposition);
								$("#bbrposdetail").val(tbrposdetail);
								$("#bbrzipcode").val($("#tbrzipcode").val())
							}

						}
						if($(this).prop("checked")==false){
							$("#bbrloc").removeClass("active");
							$("#bbrloc").attr("value","");
							$("#bbrloc").text("请选择省市");
							$(this).parent().parent().find("div[name='dtown']").remove();
							$(this).parent().parent().find("div[name='dcountryside']").remove();
							$("#bbrposdetail").val("");
							$("#bbrzipcode").val("");
						}
					})
				})


				$("input[name='residentsText']").each(function(){
					$(this).parent().addClass("radio_ctrl mui-checkbox mui-left");
					$(this).parent().css("width","100%");
					$(this).parent().find("label").css("width","100%");
					var cardtype=$(this).parent().parent().find("div[name='certificateType']").attr("value");
					/* if(cardtype=="2"||cardtype=="A"){
						$(this).parent().hide();
					} */
					$(this).click(function(){
						if($(this).prop("checked")==true){
							 var index=$("form input[name='residentsText']").index(this);
								var objectr=$(this).parent().parent().find("input[name='name']");
								var addObj=$(this).parent().parent().find("div[name='position']");
								var addDetail=$(this).parent().parent().find("input[name='posdetail']");
								var reg = /^(([\u4e00-\u9fa5]{1,20}\·?\•?){0,5}[\u4e00-\u9fa5]{1,20}$|([a-zA-Z]{1,20}\.?\s?\·?\-?\•?){0,5}[a-zA-Z]{1,20}$)/;
								if(!reg.test($(objectr).val()) || $(objectr).val()==""){
									mui.alert($(objectr).attr("checktips"));
									objectr.focus();
									$(this).prop("checked",false);
									return false;
								}
								if($(addObj).html() == '请选择省市'){
									mui.alert('请选择联系地址');
									addObj.focus();
									$(this).prop("checked",false);
									return false;
								}
								var posit = $(addObj).html();
								var positStr = posit.split(' ');
								var positVal = positStr[0];
								//console.log( positVal)
								var townObj=$(this).parent().parent().find("input[name='town']");
								var countryObj=$(this).parent().parent().find("input[name='countryside']");
								var adrRes = /^[\u4e00-\u9fa5（）()]{4,30}$|^[\dA-Za-z_（）()]{10,}$|^[\dA-Za-z_\u4e00-\u9fa5（）()]{4,25}$|^[A-Za-z_\u4e00-\u9fa5（）()\d]{4,30}$/;
								/* if(positVal=='浙江省'){
									 if($(townObj).val()==""){
										mui.alert($(townObj).attr("checktips"));
										townObj.focus();
										$(this).prop("checked",false);
										return false;
									 }
									 if($(countryObj).val()==''){
										 mui.alert($(countryObj).attr("checktips"));
										 countryObj.focus();
										 $(this).prop("checked",false);
										 return false;
									 }
									 if(!adrRes.test($(addDetail).val())|| $(addDetail).val()==''){
										 mui.alert($(addDetail).attr("checktips"));
										 addDetail.focus();
										 $(this).prop("checked",false);
										 return false;
									 }
								}else{ */
									if(!adrRes.test($(addDetail).val())|| $(addDetail).val()==''){
										mui.alert($(addDetail).attr("checktips"));
										addDetail.focus();
										$(this).prop("checked",false);
										return false;
									}
								//}
							loadpage(this,index,getUrlParam("orderNo"),$(objectr).val());
							$("#shuoming").show();
						}else{
							$(this).val("");
							$("#shuoming").hide();
						}

					})
				})

				$("input[name='ttbr']").each(function(){
					$("input[name='ttbr']").prop("checked")==false
					$(this).parent().addClass("radio_ctrl mui-checkbox mui-left");
					$(this).parent().css("width","100%");
					$(this).parent().find("label").css("width","100%");
					var ttbrflag=false;
					$(this).click(function(){
						if($(this).prop("checked")==true){
							var ttbrflag=0;
							var ttbrlist=$("input[name='ttbr']");
							for(var i=0,ilen=ttbrlist.length;i<ilen;i++){
								if($(ttbrlist[i]).prop("checked")==true){
									ttbrflag+=1;
								}
							}
							var tbbrgx=$("#tbrinfo").find("div[name='relateInsured']").attr("value");
							if(tbbrgx=='00'){
	                           /*  tbbrgxVal = yes;	 */
								mui.alert("投被保人为同一人时,受益人与投保人不能为同一人");
								$(this).prop("checked",false);
								return false;
							}else{
								/* tbbrgxVal = no; */
							}
							if(ttbrflag>1){
								mui.alert("与投保人为同一人的受益人已存在");
								$(this).prop("checked",false);
								return false;
							}
							//同投保人
							var tbrobj=$("#tbrinfo");
							$(this).parent().parent().find("input[name='name']").val($(tbrobj).find("input[name='name']").val());
							$(this).parent().parent().find("div[name='certificateType']").html($(tbrobj).find("div[name='certificateType']").html());
							$(this).parent().parent().find("div[name='certificateType']").attr("value",$(tbrobj).find("div[name='certificateType']").attr("value"));
							$(this).parent().parent().find("input[name='certificateNum']").val($(tbrobj).find("input[name='certificateNum']").val());
							$(this).parent().parent().find("div[name='certValidateEndDate']").html($(tbrobj).find("div[name='certValidateEndDate']").html());
							$(this).parent().parent().find("div[name='certValidateEndDate']").attr("value",$(tbrobj).find("div[name='certValidateEndDate']").html());
							$(this).parent().parent().find("div[name='certValidateEndDate']").attr("data-value",$(tbrobj).find("div[name='certValidateEndDate']").html());
							$(this).parent().parent().find("div[name='relateInsured']").attr("value",$(tbrobj).find("div[name='relateInsured']").attr("value"));
							$(this).parent().parent().find("div[name='relateInsured']").html($(tbrobj).find("div[name='relateInsured']").html());
							$(this).parent().parent().find("div[name='relateInsured']").attr("data-value",$(tbrobj).find("div[name='relateInsured']").attr("data-value"));
							if($(this).parent().parent().find("div[name='certValidateEndDate']").html().indexOf("请选择")==-1){
								$(this).parent().parent().find("div[name='certValidateEndDate']").addClass("active");
							}else{
								$(this).parent().parent().find("div[name='certValidateEndDate']").removeClass("active");
							}
							$(this).parent().parent().find("input[name='checkbox1']").prop("checked",$(tbrobj).find("input[name='checkbox1']").prop("checked"));
							$(this).parent().parent().find("input[name='checkbox1']").prop("disabled",$(tbrobj).find("input[name='checkbox1']").prop("disabled"));
							if($(tbrobj).find("div[name='gender']").hasClass("mui-active")==true){
								$(this).parent().parent().find("div[name='gender']").addClass("mui-active");
							}else{
								$(this).parent().parent().find("div[name='gender']").removeClass("mui-active");
							}
							$(this).parent().parent().find("div[name='birthDate']").html($(tbrobj).find("div[name='birthDate']").html());
							$(this).parent().parent().find("div[name='birthDate']").attr("value",$(tbrobj).find("div[name='birthDate']").html());
							$(this).parent().parent().find("div[name='birthDate']").attr("data-value",$(tbrobj).find("div[name='birthDate']").html());
							if($(this).parent().parent().find("div[name='birthDate']").html().indexOf("请选择")==-1){
								$(this).parent().parent().find("div[name='birthDate']").addClass("active");
							}else{
								$(this).parent().parent().find("div[name='birthDate']").removeClass("active");
							}

							if($('#tbrsex').hasClass('mui-active')){
								$('#ssrsex').addClass('mui-active');
								$('#ssrsex').parent().find('.mui-switch-handle').css({
								         "transform": "translate(43px, 0px)"
							        })
							}



						}else{
							//非同投保人
							$(this).parent().parent().find("input[name='name']").val("");
							$(this).parent().parent().find("div[name='certificateType']").html(JSON.parse($(this).parent().parent().find("div[name='certificateType']").attr("selectdata"))[0].text);
							$(this).parent().parent().find("div[name='certificateType']").attr("value",JSON.parse($(this).parent().parent().find("div[name='certificateType']").attr("selectdata"))[0].value);
							$(this).parent().parent().find("input[name='certificateNum']").val("");
							$(this).parent().parent().find("div[name='certValidateEndDate']").html("请选择日期");
							$(this).parent().parent().find("div[name='certValidateEndDate']").attr("value","");
							$(this).parent().parent().find("div[name='certValidateEndDate']").attr("data-value","");
							$(this).parent().parent().find("div[name='relateInsured']").attr("value",JSON.parse($(this).parent().parent().find("div[name='relateInsured']").attr("selectdata"))[0].value);
							$(this).parent().parent().find("div[name='relateInsured']").html(JSON.parse($(this).parent().parent().find("div[name='relateInsured']").attr("selectdata"))[0].text);
							$(this).parent().parent().find("div[name='relateInsured']").attr("data-value",JSON.parse($(this).parent().parent().find("div[name='relateInsured']").attr("selectdata"))[0].value);
							if($(this).parent().parent().find("div[name='certValidateEndDate']").html().indexOf("请选择")==-1){
								$(this).parent().parent().find("div[name='certValidateEndDate']").addClass("active");
							}else{
								$(this).parent().parent().find("div[name='certValidateEndDate']").removeClass("active");
							}
							$(this).parent().parent().find("input[name='checkbox1']").prop("checked",false);
							$(this).parent().parent().find("input[name='checkbox1']").prop("disabled",false);
							$(this).parent().parent().find("div[name='gender']").addClass("mui-active");

							$(this).parent().parent().find("div[name='birthDate']").html("请选择日期");
							$(this).parent().parent().find("div[name='birthDate']").attr("value","");
							$(this).parent().parent().find("div[name='birthDate']").attr("data-value","");
							if($(this).parent().parent().find("div[name='birthDate']").html().indexOf("请选择")==-1){
								$(this).parent().parent().find("div[name='birthDate']").addClass("active");
							}else{
								$(this).parent().parent().find("div[name='birthDate']").removeClass("active");
							}
						}

					})
				})


				$("input[name='certificateNum']").each(function(){
					$(this).focus(function(){
						var cardNum=$(this).val();
						var cardtype=$(this).parent().parent().find("div[name='certificateType']").attr("value");
						if(cardtype=='1' || cardtype=='12'){
							$(this).attr("maxlength","18");
						}
						if(cardtype=='2' || cardtype=='3' || cardtype=='6' ||cardtype=='7'){

							$(this).attr("maxlength","10");

						}
						if(cardtype=='FM'){
							$(this).attr("maxlength","20");
						}
						if(cardtype=='8'){
							$(this).attr("maxlength","11");
						}
						if(cardtype=='9' || cardtype=='11'){
							$(this).attr("maxlength","18");
						}

						if(cardtype=='10'){
							$(this).removeAttr("maxlength");
						}
					})
				})

				$("input[name='certificateNum']").each(function(){
					$(this).blur(function(){
						//console.log($(this).val())
						//身份证信息带出
						var cardNum=$(this).val();
						var cardtype=$(this).parent().parent().find("div[name='certificateType']").attr("value");
						if(cardtype=='1'){//||cardtype=='4'||cardtype=='C'
							$(this).attr("maxlength","18");
							var reg = eval($(this).attr("checkRul"));
							$(this).parent().parent().find("div[name='certValidateEndDate']").html("请选择日期");
							$(this).parent().parent().find("div[name='certValidateEndDate']").removeClass("active");
							$(this).parent().parent().find("div[name='certValidateEndDate']").attr("value","");
							$(this).parent().parent().find("div[name='certValidateEndDate']").attr("data-value","");
							if(!YchencheckIdCard(cardNum)){
								var msg=$(this).prev().html();
								msg=msg.substring(msg.lastIndexOf(">")+1,msg.length-1);
								mui.alert($(this).attr("checkTips"));
								$(this).parent().parent().find("input[name='checkbox1']").prop("disabled",false);

								$(this).parent().parent().find("input[name='checkbox1']").prop("checked",false);
								if(!$(this).parent().parent().find("div[name='certValidateEndDate']").hasClass("select_validity")){
									$(this).parent().parent().find("div[name='certValidateEndDate']").addClass("select_validity");
								}
								return false;
							}
							var birthday=cardNuminfo(cardNum,1);
							//console.log(productCode,11111111)
							/*  if($(this).parent().parent().find("div[name='birthDate']").attr("jysflag")!="true"){  */
							if(productCode != 100040 || ((productCode == 100040||productCode == 100130) && $('#reInsured').text() !='本人') ){
								$(this).parent().parent().find("div[name='birthDate']").html(birthday);
								$(this).parent().parent().find("div[name='birthDate']").addClass("active");
								$(this).parent().parent().find("div[name='birthDate']").attr("data-value",birthday);

								var sex=cardNuminfo(cardNum,2);
								if(sex=='男'){
									var obj = $(this).parent().parent().find("div[name='gender']");
									if(!$(obj).hasClass("mui-disabled")){
										obj.removeClass("mui-active");
										obj.addClass("mui-active");
										obj.find("div").attr("style","transition-duration: 0.2s; transform: translate(43px, 0px);");
									}

								}
								if(sex=='女'){
									var obj = $(this).parent().parent().find("div[name='gender']");
									if(!$(obj).hasClass("mui-disabled")){
										obj.removeClass("mui-active");
										obj.find("div").attr("style","transition-duration: 0.2s; transform: translate(0px, 0px);");
									}
								}
							}
							if(cardNum.indexOf('x')==cardNum.length-1){
								$(this).val(cardNum.substring(0,cardNum.length-1)+"X");
							}
							//var dizhi = id_card_area.getAreaByIdCard(cardNum, this);
							var age=ageCf(birthday,new Date());
							storage.set('age18',age)
							console.log("年龄："+age);
							if(age<18&&cardtype=='0'){
								$(this).parent().parent().find("input[name='checkbox1']").prop("disabled",true);
								$(this).parent().parent().find("div[name='certValidateEndDate']").html("请选择日期");
								$(this).parent().parent().find("div[name='certValidateEndDate']").removeClass("active");
								$(this).parent().parent().find("div[name='certValidateEndDate']").attr("value","");
								$(this).parent().parent().find("div[name='certValidateEndDate']").attr("data-value","");
								$(this).parent().parent().find("input[name='checkbox1']").prop("checked",false);
							}else{
								$(this).parent().parent().find("input[name='checkbox1']").prop("disabled",false);
							}
							 if(age<46){
								 $("input[name='checkbox1']").attr('disabled',true);
								 $(this).parent().parent().find("div[name='certValidateEndDate']").html("请选择日期");

							}
						}

						/*
							{"value":"1","text":"身份证"},
							{"value":"2","text":"中国护照"},
							{"value":"3","text":"军官证"},
							{"value":"6","text":"警官证"},
							{"value":"7","text":"外国护照"},
							{"value":"8","text":"港澳通行证"},
							{"value":"9","text":"其他证件"},
							{"value":"10","text":"外国人永久居留身份证"},
							{"value":"11","text":"港澳台居民居住证"}，
							{"value":"12","text":"户口簿"},
							{"value":"13","text":"出生证明"}

							*/
						if(cardtype=='2' || cardtype=='3' || cardtype=='6' ||cardtype=='7'||cardtype=='13'){
							$("input[name='checkbox1']").attr("disabled",false)
							$(this).attr("maxlength","10");

							var reg =  /^[\da-z]+$/i;
							if(!reg.test($(this).val())){
								var msg=$(this).prev().html();
								msg=msg.substring(msg.lastIndexOf(">")+1,msg.length-1);
								mui.alert($(this).attr("checkTips"));
								return false;
							}
							var toUpper = $(this).val().toUpperCase();
							$(this).val(toUpper)
						};
						if(cardtype=='8'){
							$("input[name='checkbox1']").attr("disabled",false)
							$(this).attr("maxlength","11");
							var reg =  /^[\da-z]+$/i;
							if(!reg.test($(this).val())){
								var msg=$(this).prev().html();
								msg=msg.substring(msg.lastIndexOf(">")+1,msg.length-1);
								mui.alert($(this).attr("checkTips"));
								return false;
							}
							var toUpper = $(this).val().toUpperCase();
							$(this).val(toUpper)
						}
						if(cardtype=='9' || cardtype=='11'|| cardtype=='12'){
							$("input[name='checkbox1']").attr("disabled",false)
							$(this).attr("maxlength","18");
							var reg =  /^[\da-z]+$/i;
							if(!reg.test($(this).val())){
								var msg=$(this).prev().html();
								msg=msg.substring(msg.lastIndexOf(">")+1,msg.length-1);
								mui.alert($(this).attr("checkTips"));
								return false;
							}
							var toUpper = $(this).val().toUpperCase();
							$(this).val(toUpper)
						}

						if(cardtype=='10'){
							$("input[name='checkbox1']").attr("disabled",false)
							var reg =  /^[\da-z]+$/i;
							if(!reg.test($(this).val())){
								var msg=$(this).prev().html();
								msg=msg.substring(msg.lastIndexOf(">")+1,msg.length-1);
								mui.alert($(this).attr("checkTips"));
								return false;
							}

							var toUpper = $(this).val().toUpperCase();
							$(this).val(toUpper)
						}

						/* var caType= $("div[name='certificateType']").html();
						if(caType=='港澳台居民居住证'){
							 $("input[name='checkbox1']").attr('disabled',true);
						} */

					})

				});

				//受益人出生证明户口簿有效期
				$("div[name='birthDate']").each(function(){
					$(this).bind('DOMNodeInserted',function(e) {
						$(this).parent().parent().find("div[name='certValidateEndDate']").html("请选择日期");
						$(this).parent().parent().find("div[name='certValidateEndDate']").removeClass("active");
						$(this).parent().parent().find("div[name='certValidateEndDate']").attr("value","");
						$(this).parent().parent().find("div[name='certValidateEndDate']").attr("data-value","");
						var syrbirday = $(this).parent().parent().find("div[name='birthDate']").text();
						var certificateType = $(this).parent().parent().find("div[name='certificateType']").attr("value");
						if (syrbirday && certificateType && certificateType != '1') {
							var cardVal = cardValidity(syrbirday, certificateType);
							if(cardVal){
								$(this).parent().parent().find("div[name='certValidateEndDate']").html(cardVal);
								$(this).parent().parent().find("div[name='certValidateEndDate']").addClass("active");
								$(this).parent().parent().find("div[name='certValidateEndDate']").attr("data-value",cardVal);
							}
						}
					})
				})
				//被保险人出生证明户口簿有效期
				$("div[id='brbirday']").each(function(){
					$(this).bind('DOMNodeInserted',function(e) {
						$(this).parent().parent().find("div[name='certValidateEndDate']").html("请选择日期");
						$(this).parent().parent().find("div[name='certValidateEndDate']").removeClass("active");
						$(this).parent().parent().find("div[name='certValidateEndDate']").attr("value","");
						$(this).parent().parent().find("div[name='certValidateEndDate']").attr("data-value","");
						var bbrBirthday = $("#brbirday").text();
						var certificateType = $('#brcardtype').attr("value");
						if (bbrBirthday && certificateType) {
							var cardVal = cardValidity(bbrBirthday, certificateType);
							if(cardVal){
								$(this).parent().parent().find("div[name='certValidateEndDate']").html(cardVal);
								$(this).parent().parent().find("div[name='certValidateEndDate']").addClass("active");
								$(this).parent().parent().find("div[name='certValidateEndDate']").attr("data-value",cardVal);
							}
						}
					})
				})

				$("div[name='certificateType']").each(function(){
					$(this).bind('DOMNodeInserted',function(e) {
						var cardtype=$(this).text();
						//console.log($(this).text());
					   if(cardtype=="身份证"){
						   if(storage.get("age18")<"46"){
							   console.log("小于46周岁")
							   //$(this).parent().parent().find('input[name="checkbox1"]').css("background","red")
							   $(this).parent().parent().find('input[name="checkbox1"]').attr("disabled","disabled");
							   console.log($(this).parent().parent().find('input[name="checkbox1"]').attr("disabled"));
							   if($("input[name='checkbox1']").attr("checked")){
								   $("input[name='checkbox1']").attr("checked",false)
							   }
						   }else{
							   console.log("大于46周岁")
							   $("input[name='checkbox1']").attr("checked",false);
							   $(this).parent().parent().find('input[name="checkbox1"]').attr("disabled",false);
						   };
					   };
					   if(cardtype!="身份证"){
						   //$(this).parent().parent().find('input[name="checkbox1"]').css("background","green")
						   console.log("不是身份证")
						   $("input[name='checkbox1']").attr("checked",false)
						   $(this).parent().parent().find('input[name="checkbox1"]').prop("disabled",false);
					   }
					});
				});
				$("input[name='postalCode']").each(function(){
					$(this).attr("maxlength","6");
					$(this).attr("type","number");
					$(this).attr("oninput","if(value.length>6)value=value.slice(0,6)");
				})
				//sjx 11-25 19:25新增单位邮编
				$("input[name='workpostalCode']").each(function(){
					$(this).attr("maxlength","6");
					$(this).attr("type","number");
					$(this).attr("oninput","if(value.length>6)value=value.slice(0,6)");
				})

				//sjx 2020-08-19优化受益比例录入项规则
				$("input[id='ssrbili']").each(function(){
					$(this).attr("type","number");
				})

				$("input[name='mobile']").each(function(){
					$(this).attr("maxlength","11");
					$(this).attr("type","number");
					$(this).attr("oninput","if(value.length>11)value=value.slice(0,11)");
				})
				$("input[id='longtime']").each(function(){

					$(this).click(function(){
						if($(this).prop("checked")==true){
							$(this).parent().prev().html("9999-12-31");
							$(this).parent().prev().addClass("active");
						}else{
							$(this).parent().prev().html("请选择日期");
							$(this).parent().prev().removeClass("active");
						}
					})
					$(this).change(function(){
						if($(this).prop("disabled")==true){
							$(this).prop("checked",false);
						}
					})
				})
				$("input[name='accno']").each(function(){
					$(this).attr("maxlength","19");
					$(this).attr("type","number");
					$(this).attr("oninput","if(value.length>19)value=value.slice(0,19)");
				})
				$("input[id='samehj']").each(function(){
					$(this).parent().css("left","15px");
					$(this).parent().css("width","100px");
					$(this).click(function(){
						if($(this).prop("checked")==true){
							if($(this).parent().parent().parent().find("div[name='permposition']").html().indexOf("请选择")!=-1){
								mui.alert("请先选择户籍地址!");
								$(this).prop("checked"==false);
								return false;
							}
							$(this).parent().parent().find("input[name='posdetail']").val($(this).parent().parent().parent().find("input[name='permposdetail']").val());
							$(this).parent().parent().prev().find("div[name='position']").attr("value",$(this).parent().parent().parent().find("div[name='permposition']").attr("value"));
							$(this).parent().parent().prev().find("div[name='position']").html($(this).parent().parent().parent().find("div[name='permposition']").html());
							$(this).parent().parent().prev().find("div[name='position']").addClass("active");
						}else{
							$(this).parent().parent().find("input[name='posdetail']").val("");
							$(this).parent().parent().prev().find("div[name='position']").attr("value","");
							$(this).parent().parent().prev().find("div[name='position']").html("请选择省市");
							$(this).parent().parent().prev().find("div[name='position']").removeClass("active");
						}
					})
				})
				$("div[name='career']").each(function(){
					if(typeof($(this).attr("value"))=='undefined'||$(this).attr("value")==""){
						$(this).html("请选择职业");
					}
				})
				//受益人信息下划线
				/* var isActive = document.getElementById("fadingsyr").classList.contains("mui-active");
				if(isActive){
					$('#ssyinfo .mui-input-row:nth-child(2)').css({
						'border':'none'
					})
				} */
				if(document.getElementById("fadingsyr")!=null){
				     var isActive = document.getElementById("fadingsyr").classList.contains("mui-active");
				     if(isActive){
				      $('#ssyinfo .mui-input-row:nth-child(2)').css({
				       'border':'none'
				      })
				     }
				}
				$("div[name='fading']").each(function(){
					if($(this).attr("class").indexOf("mui-active")!=-1){
						$(this).parent().nextAll().hide();
					}else{
						$(this).parent().nextAll().show();
						$(this).parent().parent().find(".remove_insured_wrap").hide();
					}
					/* $(this).click(function(){
						if($(this).attr("class").indexOf("mui-active")==-1){
							$(this).parent().nextAll().show();
							$(this).parent().parent().find(".remove_insured_wrap").hide();
							$(this).parent().parent().find(".add_insured").show();
						}else{
							$(this).parent().nextAll().hide();
							var benleng=$(".beneficiary_form").length;
							console.log(benleng);
							if(benleng>1){
								$(".beneficiary_form:gt(0)").remove();
							}
						}
					}) */
					this.addEventListener("toggle",function(event){
						if($(this).attr("class").indexOf("mui-active")==-1){
							$(this).parent().nextAll().show();
							$(this).parent().parent().find(".remove_insured_wrap").hide();
							$(this).parent().parent().find(".add_insured").show();

							//sjx 2020-01-08新增,当不是法定受益人时,受益顺位默认隐藏
							$('div[id="syposition"]').parent().hide()
							//受益人信息下划线
							$('#ssyinfo .mui-input-row:nth-child(2)').css({
								'borderBottom':'1px dashed #2667bf'
							});
							/* $('.tongbbraddress_div_class').css({
								'border':'none'
							}) */
							/* $('.syrsynposition_div_class').css({
								'border':'none'
							}) */
							/* $('input[id="syrsynposition"]').parent().css({
								'border':'none'
							});  */
							/* $('input[id="tongbbraddress"]').parent().css({
								'border':'none'
							}); */
						}else{
							$(this).parent().nextAll().hide();
							var benleng=$(".beneficiary_form").length;
							//console.log(benleng);
							//受益人信息下划线
							$('#ssyinfo .mui-input-row:nth-child(2)').css({
								'border':'none'
							})
							if(benleng>1){
								$(".beneficiary_form:gt(0)").remove();
							}
						}
					})
				})
				if($(".beneficiary_form").length>1){
					for(var i=0,len=$(".beneficiary_form").length;i<len;i++){
						if(i==0){
							$($(".beneficiary_form")[i]).find('.add_insured').hide();
						}
						if(i>0){
							$($(".beneficiary_form")[i]).find('.remove_insured_wrap').show();
							$($(".beneficiary_form")[i]).find('#fadingsyr').parent().remove();
						}
					}
				}

				$("form").on("blur","input[name='name']",function(){
			        $(this).parent().parent().find("input[name='residentsText']").prop("checked",false);
			        $(this).parent().parent().find("input[name='residentsText']").val("");
			    });
				if($(".relationship").html()=="本人"){
					hidebbr();
				}else{
					showbbr();
				}
				$("input[name='posdetail']").each(function(){
					$(this).attr("maxlength","64");
				})
				$("input[name='permposdetail']").each(function(){
					$(this).attr("maxlength","64");
				})
				$("input[name='salary']").each(function(){
					$(this).attr("maxlength","5");
					$(this).attr("type","number");
					$(this).attr("oninput","if(value.length>5)value=value.slice(0,5)");
				})
				$("input[name='familySalary']").each(function(){
					$(this).attr("maxlength","5");
					$(this).attr("type","number");
					$(this).attr("oninput","if(value.length>5)value=value.slice(0,5)");
				})
				$("input[name='height']").each(function(){
					$(this).attr("maxlength","3");
					$(this).attr("type","number");
					$(this).attr("oninput","if(value.length>3)value=value.slice(0,3)");
				})
				$("input[name='weight']").each(function(){
					$(this).attr("maxlength","6");
					$(this).attr("type","number");
					$(this).attr("oninput","if(value.length>6)value=value.slice(0,6)");
				})
				$("input[name='workUnits']").each(function(){
					$(this).css("width","50%");
					$(this).prev().css("width","50%");
				})

				$("input[name='checkbox1']").each(function(){
					if($(this).attr("id")=="samehj"){
						$(this).css("left","75px");
						var prevf=$(this).prev();
						$(prevf).attr("style","padding-left:0px !important");
					}
				})

				$(".beneficiary_form").each(function(){
					var self=$(this);
					$(self).find("input[name='name']").on("input",function(){
						$(self).find("input[name='ttbr']").prop("checked",false);
					})
					$(self).find("input[name='certificateNum']").on("input",function(){
						$(self).find("input[name='ttbr']").prop("checked",false);
					})
					$(self).find("input[id='longtime']").on("change",function(){
						$(self).find("input[name='ttbr']").prop("checked",false);
					})
					$(self).find("input[id='gender']").on("click",function(){
						$(self).find("input[name='ttbr']").prop("checked",false);
					})
				})

				$("input[name='permposdetail']").each(function(){
					$(this).attr("oninput","changepermposdetail(this);");
					$(this).attr("onblur","changepermposdetailText(this);");
				});
				$("input[name='posdetail']").each(function(){
					$(this).attr("onblur","changeposdetailText(this);");
					/* $(this).attr("oninput","inputNumDecimal(this);"); */
				});


				//ocr
				$(".ocr").after("<img  class='message' src='../images/message.png'>");
				$(".ocr").after("<div  class='messageMark' style='z-index:1;display:none;width:100%;height:100%;position:fixed;top:0;left:0;'></div>");
				$(".ocr").after("<p class='prompt' style='color:rgb(255,255,255);'>OCR身份证识别：<br/>1、将身份证正面拍照识别<br/>2、将身份证反面拍照识别</p>")
				mui("body").on("tap",".message",function(){
						scrollTop=$(window).scrollTop();
						X=$(this).parent().offset();
						$(this).siblings(".messageMark").show();
						$(this).siblings(".prompt").css("display","block");
						$(this).siblings(".prompt").css("position","absolute").css("top",'38px');
						/* $(this).siblings(".prompt").css("position","fixed").css("top",Number(X.top-scrollTop)+Number(40)); */
				}).on("release",".message",function(){
					$(this).siblings(".prompt").hide(100);
				});
				// 点击自身隐藏
				mui("body").on("tap",".messageMark",function(){
					$(".prompt").hide();
					$(this).hide();
				});

				if(agentinfo.channel!='2'){
					$("input[name='familySalary']").each(function(){
						$(this).parent().hide();
					})
					$("div[name='areatype']").each(function(){
						$(this).parent().hide();
					})
				}

				$(".title").each(function(){
					var innerhtml = $(this).html();
					if(innerhtml != "自保件信息" && innerhtml != "自保件/互保件信息"){
						$(this).append($("<img src='../images/notebook.png' class='cusinfo'>"));
					}else{
						var zbjtemp = $(this).parent().next();
						if(innerhtml == "自保件信息"){
							if(getUrlParam('agentCode').startsWith("HN")){
								zbjtemp.after("<div><p style='margin: 15px;'>自保件判定规则：业务员及直系亲属，作为投保人、被保人、受益人，投保1年期以上产品</p></div>")
							}else if(getUrlParam('agentCode').startsWith("SD")){
								zbjtemp.after("<div><p style='margin: 15px;'>自保件判定规则：山东辖区，销售人员及直系亲属（父母、配偶、子女）作为投保人、被保人、受益人之一，投保1年期以上产品（含≤1年的保证续保产品）。</p></div>")
							}
						}
						//2023-MT-0017_嘉兴双录需求改动
						if(innerhtml == "自保件/互保件信息"){
							zbjtemp.after("<div><p style='margin: 15px;'>自保件判定规则：销售人员或其父母、配偶、子女等直系亲属作为投保人、被保人、受益人的保单。</p><p style='margin: 15px;'>互保件判定规则：投保人、被保人、受益人为签单销售人员以外的本公司其他在职销售人员保单。</p></div>")
						}
					}
				})
				var shareIn = getUrlParam('shareIn');   //建议书分享标识
		 		var productCode = getUrlParam('productCode');
		 		if((productCode == '100040'|| productCode == '100130'|| productCode == '100170'|| productCode == '101500')&& shareIn == 'no' ){  //投资型产品  && 未分享
		 			$('.cusinfo,.ocr,.message').remove();
		 		};
		 		if((productCode == '100040'|| productCode == '100130'|| productCode == '100170'|| productCode == '101500') && shareIn == 'yes' ){   //投资型产品  && 分享
		 			$('.cusinfo,.ocr,.message').remove();
		 		};
		 		if(productCode!='100040'&& productCode != '100130'&& productCode != '100170'&& productCode != '101500' && shareIn == "no"){  //非投资  && 未分享
		 			$('.cusinfo,.ocr,.message').show();
	 			}
		 		if(productCode!='100040'&& productCode != '100130'&& productCode != '100170'&& productCode != '101500'  && shareIn == "yes"){  //非投资  && 分享
		 			$('.cusinfo').remove();
		 			$('.ocr,.message').show();
	 			}

				//加载建议书带出数据
				var nextClick = localStorage.getItem("nextClick");
				var orderNo = getUrlParam("orderNo");
				 var orderNo2 = localStorage.getItem("orderNoId");
				//console.log(nextClick,orderNo,orderNo2)
				if((proCode=='100170'||proCode=='100044'||proCode=='100040'||proCode=='100120'||proCode=='100130'||proCode=='100150' ||proCode=='100700' ||proCode=='101000' ||proCode=='101100'||proCode=='101200'||proCode=='100038'||proCode=='101300'||proCode=='101400'||proCode=='101500'
						||proCode=='101700'||proCode=='101900'||proCode=='102300')&&jysflag=="JYS"){
					$("#tbrname").val(planBookInfo.fromName);//投保人姓名带出
					$("#tbrname").prop("disabled",true);
					//console.log(planBookInfo,11111111111)

					if(planBookInfo.frombirthdy!=''){
						$("#tbrinfo").find("div[name='birthDate']").html(planBookInfo.frombirthdy);//投保人出生日期带出
						$("#tbrinfo").find("div[name='birthDate']").attr("data-value",planBookInfo.frombirthdy);
						$("#tbrinfo").find("div[name='birthDate']").attr("value",planBookInfo.frombirthdy);
						$("#tbrinfo").find("div[name='birthDate']").attr("jysflag","true");
						$("#tbrinfo").find("div[name='birthDate']").removeClass("select_birthday");
						$("#mbbrinfo").find("div[name='birthDate']").attr('class','select_item select_birthday dateselect active')
					}
					if(planBookInfo.fromsex!=''){
						//投保人性别
						if(planBookInfo.fromsex=="0" &&planBookInfo.relation=="00"){
							$("#tbrinfo").find("div[name='gender']").addClass("mui-disabled mui-active");
						}
						if(planBookInfo.fromsex=="1" &&planBookInfo.relation=="00"){
							$("#tbrinfo").find("div[name='gender']").removeClass("mui-active");
							$("#tbrinfo").find("div[name='gender']").addClass("mui-disabled");
						}
						if(planBookInfo.fromsex=="0" &&planBookInfo.relation!="00"){
							$("#tbrinfo").find("div[name='gender']").addClass("mui-disabled mui-active");
						}
						if(planBookInfo.fromsex=="1" &&planBookInfo.relation!="00"){
							$("#tbrinfo").find("div[name='gender']").removeClass("mui-active");
							$("#tbrinfo").find("div[name='gender']").addClass("mui-disabled");
						}

					}
					if(planBookInfo.fromoccupationcode =='T03' || planBookInfo.fromoccupationcode =='T01' || planBookInfo.fromoccupationcode =='O02'){
	 					$("#tbrinfo").find("input[name='salary']").val('0');
	 				}
	 				if(planBookInfo.occupationcode =='T03' || planBookInfo.occupationcode =='T01' || planBookInfo.occupationcode =='O02'){
	 					$("#mbbrinfo").find("input[name='salary']").val('0');
	 				}
					/* 医疗保险 */
					if(planBookInfo.relation=="00" && planBookInfo.socialhealth=='1'){
						$("#tbrinfo").find("div[name='isOtherSec']").addClass("mui-active");
						$("#tbrinfo").find("div[name='isOtherSec']").addClass("mui-disabled");
					}else if(planBookInfo.relation=="00" && planBookInfo.socialhealth=='0'){
						$("#tbrinfo").find("div[name='isOtherSec']").removeClass("mui-active");
						$("#tbrinfo").find("div[name='isOtherSec']").addClass("mui-disabled");
					}
					if(planBookInfo.relation !="00" && planBookInfo.socialhealth=='1'){
						$("#mbbrinfo").find("div[name='isOtherSec']").addClass("mui-active");
						$("#mbbrinfo").find("div[name='isOtherSec']").addClass("mui-disabled");
					}else if(planBookInfo.relation !="00" && planBookInfo.socialhealth=='0'){
						$("#mbbrinfo").find("div[name='isOtherSec']").removeClass("mui-active");
						$("#mbbrinfo").find("div[name='isOtherSec']").addClass("mui-disabled");
					}

					if(planBookInfo.fromoccupationcode!=''){
						//投保人职业
						for(var i=0,ilen=_OCC.length;i<ilen;i++){
							/* {"code":"0001001","name":"机关团体公司行号内勤人员","level":"1"} */
							if(_OCC[i].code==planBookInfo.fromoccupationcode){
								$("#tbrinfo").find("div[name='career']").html(_OCC[i].name);
								$("#tbrinfo").find("div[name='career']").attr("data-value",_OCC[i].code);
								$("#tbrinfo").find("div[name='career']").attr("value",_OCC[i].code);
								$("#tbrinfo").find("div[name='career']").attr("jobtype",_OCC[i].level);
								$("#tbrinfo").find("div[name='career']").addClass("active");
								$("#tbrinfo").find("div[name='career']").removeClass("job");
								break;
							}
						}
					}
					//投保人与被保人关系
					if(planBookInfo.relation!=''){
						var relateJson=JSON.parse($("#mbbrinfo").find("div[name='relateInsured']").attr("selectdata"));
						if(planBookInfo.relation=='31'){
							planBookInfo.relation='32'
						}else if(planBookInfo.relation=='32'){
							planBookInfo.relation='31'
						}
						for(var i=0,ilen=relateJson.length;i<ilen;i++){

							if(planBookInfo.relation==relateJson[i].value){
								$("#tbrinfo").find("div[name='relateInsured']").html(relateJson[i].text);
								$("#tbrinfo").find("div[name='relateInsured']").attr("data-value",planBookInfo.relation);
								$("#tbrinfo").find("div[name='relateInsured']").attr("value",planBookInfo.relation);
								$("#tbrinfo").find("div[name='relateInsured']").addClass("active");
								$("#tbrinfo").find("div[name='relateInsured']").removeClass("textselect");
								if(relateJson[i].value!="00"){
									showbbr();
									Relations(relateJson[i].value);
								}
							}
						}

					}
					planBookBbr();//建议书被保人信息带出
				}

				function planBookBbr(){
					var gx=$("#tbrinfo").find("div[name='relateInsured']").html();//获取默认投被保人关系
					//console.log(planBookInfo,333333333)
					if(gx!="本人"){
						//关系不是本人默认带出建议书被保人信息
						//console.log(planBookInfo,22222222)
						$("#bbrname").val(planBookInfo.toName);//被保人姓名带出
					 	$("#bbrname").prop("disabled",true);
					 	$("#mbbrinfo").find("div[name='birthDate']").html(planBookInfo.birthday);//被保出生日期带出
						$("#mbbrinfo").find("div[name='birthDate']").attr("data-value",planBookInfo.birthday);
						$("#mbbrinfo").find("div[name='birthDate']").attr("value",planBookInfo.birthday);
						$("#mbbrinfo").find("div[name='birthDate']").attr("jysflag","true");
						$("#mbbrinfo").find("div[name='birthDate']").removeClass("select_birthday");
						$("#mbbrinfo").find("div[name='birthDate']").addClass("active");
					 	$('#bbrcardnum').blur(function(){
					 		$("#mbbrinfo").find("div[name='birthDate']").html(planBookInfo.birthday);//被保出生日期带出
							$("#mbbrinfo").find("div[name='birthDate']").attr("data-value",planBookInfo.birthday);
							$("#mbbrinfo").find("div[name='birthDate']").attr("value",planBookInfo.birthday);
							$("#mbbrinfo").find("div[name='birthDate']").attr("jysflag","true");
							$("#mbbrinfo").find("div[name='birthDate']").removeClass("select_birthday");
							$("#mbbrinfo").find("div[name='birthDate']").addClass("active");

					 	})
						$('#tbrcardnum').blur(function(){
					 		$("#tbrinfo").find("div[name='birthDate']").html(planBookInfo.frombirthdy);//被保出生日期带出
							$("#tbrinfo").find("div[name='birthDate']").attr("data-value",planBookInfo.frombirthdy);
							$("#tbrinfo").find("div[name='birthDate']").attr("value",planBookInfo.frombirthdy);
							$("#tbrinfo").find("div[name='birthDate']").attr("jysflag","true");
							$("#tbrinfo").find("div[name='birthDate']").removeClass("select_birthday");
							$("#tbrinfo").find("div[name='birthDate']").addClass("active");

					 	})
						//被保人性别
						if(planBookInfo.sex=="0"){
							$("#mbbrinfo").find("div[name='gender']").addClass("mui-active");
							$("#mbbrinfo").find("div[name='gender']").addClass("mui-disabled");
						}else{
							$("#mbbrinfo").find("div[name='gender']").removeClass("mui-active");
							$("#mbbrinfo").find("div[name='gender']").addClass("mui-disabled");
						}
						//被保人职业
						if(planBookInfo.occupationcode!=''){
							//被保人职业
							for(var i=0,ilen=_OCC.length;i<ilen;i++){
								/* {"code":"0001001","name":"机关团体公司行号内勤人员","level":"1"} */
								if(_OCC[i].code==planBookInfo.occupationcode){
									$("#mbbrinfo").find("div[name='career']").html(_OCC[i].name);
									$("#mbbrinfo").find("div[name='career']").attr("data-value",_OCC[i].code);
									$("#mbbrinfo").find("div[name='career']").attr("value",_OCC[i].code);
									$("#mbbrinfo").find("div[name='career']").attr("jobtype",_OCC[i].level);
									$("#mbbrinfo").find("div[name='career']").addClass("active");
									$("#mbbrinfo").find("div[name='career']").removeClass("job");
									break;
								}
							}
						}

					}
				}


				if(nextClick == null || orderNo != orderNo2){

			 			if((proCode=='100170'||proCode=='100044'||proCode=='100020'||proCode=='100060'||proCode=='100070'||proCode=='100080'||proCode=='100100'||proCode=='100140'||proCode=='100160'||proCode=='100500' ||proCode=='100400' ||proCode=='100280' ||proCode=='100300'  || proCode == '100700' || proCode=='100800' || proCode=='100900' || proCode=='100150' || proCode=='101000' || proCode=='101100'|| proCode=='100038' || proCode=='101300'
								|| proCode=='101400'|| proCode=='101500'|| proCode=='101700'|| proCode=='101900'||proCode=='102300')&& jysflag=='JYS'){
			 	 			console.log(planBookInfo,787878)
			 				$("#tbrname").val(planBookInfo.fromName);//投保人姓名带出
			 				if(planBookInfo.relation=="00"){
			 					planBookInfo.toName='';
			 				}
			 				if(planBookInfo.frombirthdy!=''){
			 					$("#tbrinfo").find("div[name='birthDate']").html(planBookInfo.frombirthdy);//投保人出生日期带出
			 					$("#tbrinfo").find("div[name='birthDate']").attr("data-value",planBookInfo.frombirthdy);
			 					$("#tbrinfo").find("div[name='birthDate']").attr("value",planBookInfo.frombirthdy);
			 					$("#tbrinfo").find("div[name='birthDate']").attr("jysflag","true");
			 					$("#tbrinfo").find("div[name='birthDate']").addClass("active");
			 				}
			 				if(planBookInfo.fromsex!=''){
			 					//投保人性别
			 					if(planBookInfo.fromsex=="0"){
			 						$("#tbrinfo").find("div[name='gender']").addClass("mui-active");
			 						/* $("#tbrinfo").find("div[name='gender']").addClass("mui-disabled"); */
			 					}else{
			 						$("#tbrinfo").find("div[name='gender']").removeClass("mui-active");
			 					/* $("#tbrinfo").find("div[name='gender']").addClass("mui-disabled"); */
			 					}
			 				}
			 				if(planBookInfo.fromoccupationcode!=''){
			 					//投保人职业
			 					for(var i=0,ilen=_OCC.length;i<ilen;i++){
			 						/* {"code":"0001001","name":"机关团体公司行号内勤人员","level":"1"} */
			 						if(_OCC[i].code==planBookInfo.fromoccupationcode){
			 							$("#tbrinfo").find("div[name='career']").html(_OCC[i].name);
			 							$("#tbrinfo").find("div[name='career']").attr("data-value",_OCC[i].code);
			 							$("#tbrinfo").find("div[name='career']").attr("value",_OCC[i].code);
			 							$("#tbrinfo").find("div[name='career']").attr("jobtype",_OCC[i].level);
			 							$("#tbrinfo").find("div[name='career']").addClass("active");
			 							/* $("#tbrinfo").find("div[name='career']").removeClass("job"); */
			 							break;
			 						}
			 					}
			 				}
			 				if(planBookInfo.fromoccupationcode =='T03' || planBookInfo.fromoccupationcode =='T01' || planBookInfo.fromoccupationcode =='O02'){
			 					$("#tbrinfo").find("input[name='salary']").val('0');
			 				}
			 				if(planBookInfo.occupationcode =='T03' || planBookInfo.occupationcode =='T01' || planBookInfo.occupationcode =='O02'){
			 					$("#mbbrinfo").find("input[name='salary']").val('0');
			 				}
			 				//投保人与被保人关系2
			 				if(planBookInfo.relation!=''){
			 					var relateJson=JSON.parse($("#mbbrinfo").find("div[name='relateInsured']").attr("selectdata"));
			 					if(planBookInfo.relation=='31'){
			 						planBookInfo.relation='32'
			 					}else if(planBookInfo.relation=='32'){
			 						planBookInfo.relation='31'
			 					}
			 					for(var i=0,ilen=relateJson.length;i<ilen;i++){
			 						console.log(planBookInfo.relation)
			 						if(planBookInfo.relation==relateJson[i].value){
										$("#mbbrinfo").find("div[name='relateInsured']").html(relateJson[i].text);
										$("#mbbrinfo").find("div[name='relateInsured']").attr("data-value",planBookInfo.relation);
										$("#mbbrinfo").find("div[name='relateInsured']").attr("value",planBookInfo.relation);
										$("#mbbrinfo").find("div[name='relateInsured']").addClass("active");
										$("#mbbrinfo").find("div[name='relateInsured']").removeClass("textselect");
			 							if(relateJson[i].value!="00"){
			 								showbbr();
			 								//Relations(relateJson[i].value);
			 							}
			 						}
			 					}

			 				}
			 				planBookBbr2();//建议书被保人信息带出
			 				/* function toNext(){
			 					alert()
			 				} */
			 			}

			 	 		function planBookBbr2(){
			 	 			var gx=$("#tbrinfo").find("div[name='relateInsured']").html();//获取默认投被保人关系
			 	 			/* 被保人姓名 */
			 	 			$("#bbrname").val(planBookInfo.toName);
			 	 			if(gx!="本人"){

			 	 				//关系不是本人默认带出建议书被保人信息
			 	 				/* $("#bbrname").val(planBookInfo.toName);//被保人姓名带出 */
			 	 				$("#bbrname").prop('disabled',false)
			 	 				$("#mbbrinfo").find("div[name='birthDate']").html(planBookInfo.birthday);//被保出生日期带出
			 	 				$("#mbbrinfo").find("div[name='birthDate']").attr("data-value",planBookInfo.birthday);
			 	 				$("#mbbrinfo").find("div[name='birthDate']").attr("value",planBookInfo.birthday);
			 	 				$("#mbbrinfo").find("div[name='birthDate']").attr("jysflag","true");
			 	 				$("#mbbrinfo").find("div[name='birthDate']").attr('class','select_item select_birthday dateselect active');
			 	 				//被保人性别
			 	 				if(planBookInfo.sex=="0"){
			 	 					$("#mbbrinfo").find("div[name='gender']").addClass("mui-active");

			 	 				}else{
			 	 					$("#mbbrinfo").find("div[name='gender']").removeClass("mui-active");

			 	 				}
			 	 				//被保人职业
			 	 				if(planBookInfo.occupationcode!=''){
			 	 					//被保人职业
			 	 					for(var i=0,ilen=_OCC.length;i<ilen;i++){
			 	 						/* {"code":"0001001","name":"机关团体公司行号内勤人员","level":"1"} */
			 	 						if(_OCC[i].code==planBookInfo.occupationcode){
			 	 							$("#mbbrinfo").find("div[name='career']").html(_OCC[i].name);
			 	 							$("#mbbrinfo").find("div[name='career']").attr("data-value",_OCC[i].code);
			 	 							$("#mbbrinfo").find("div[name='career']").attr("value",_OCC[i].code);
			 	 							$("#mbbrinfo").find("div[name='career']").attr("jobtype",_OCC[i].level);
			 	 							$("#mbbrinfo").find("div[name='career']").addClass("active");
			 	 							break;
			 	 						}
			 	 					}
			 	 				}

			 	 			}
			 	 		}

				}
				//修复生产环境bug(第一次用户录入选择的法定受益人,当再次回到信息录入页面新增受益人时,户籍所在地不校验的问题)
				if($('#fadingsyr').hasClass('mui-active')){
					$('input[name="syrsynposition"]').parents("form.ssyinfo").find('div[id="permposition"]').html('请选择')
				}
                changeMobileRemark();
                if('0' == mobileVerify){
                    showMobileRemark();
                }else{
                    hideMobileRemark();
                }
                $('#mobileVerify').val('您输入的手机号码非本人实名认证，请补充以下信息：');
				//初始化
				changeSalaryRemark();
				if('0' == salaryVerify){
					showSalaryRemark();
				}else{
					hideSalaryRemark();
				}
				$('#salaryVerify').val('根据投保人的职业和年收入,请填写如下情况说明：');
			} catch(e) {
				//mui.alert(e.message);
				alert(e.message);
			}
			//职位选择,校验
			$("#c3").on("tap","li",function(){
				var formId = whichJobClick.parent().parent().attr("id");
				if ('tbrinfo' == formId) {
					//投保人职业
					var tbrjob = $(this).attr('value');
					//投保人年收入
					var tbrsalary = $('#tbrsalary').val();
					salaryCheck(tbrjob, tbrsalary);
				}
			});
			//年收入填写之后
			$('input[id="tbrsalary"]').change(function () {
				//投保人职业
				var tbrjob = $('#tbrjob').attr('value');
				//投保人年收入
				var tbrsalary = $('#tbrsalary').val();

				salaryCheck(tbrjob,tbrsalary);
			});
			$("div[name='permposition']").each(function(){
				    if($(this).text()=="请选择"){
				       $(this).css("color","#aaa")
				    };
				    if($(this).text()!="请选择"){
					   $(this).css("color","#333")
				    }
					$(this).bind('DOMNodeInserted',function(e) {
					   if($(this).text()=="请选择"){
					       $(this).css("color","#aaa")
					   };
					   if($(this).text()!="请选择"){
						   $(this).css("color","#333")
					   }
					})
			});
			$("div[name='maritalStatus']").each(function(){
				    if($(this).text()=="请选择"){
				       $(this).css("color","#aaa")
				    };
				    if($(this).text()!="请选择"){
					   $(this).css("color","#333")
				    }
					$(this).bind('DOMNodeInserted',function(e) {
					   if($(this).text()=="请选择"){
					       $(this).css("color","#aaa")
					   };
					   if($(this).text()!="请选择"){
						   $(this).css("color","#333")
					   }
					})
			});
			$('input[name="mobile"]').attr("checkrul",'/^1[3|4|5|6|7|8|9]\\d{9}$/')
			$('input[name="height"]').attr("checkrul","/^\\+?[1-9][0-9]*$/");//(0|[1-9][0-9]*[0-9]{1,2}) 15[^4,\\D]
			$('input[name="posdetail"]').each(function(){
			   $(this).attr("checkrul","/^[\\u4e00-\\u9fa5（）()]{4,30}$|^[\\dA-Za-z（）()]{10,}$|^[\\dA-Za-z\\u4e00-\\u9fa5（）()]{4,25}$|^[A-Za-z\\u4e00-\\u9fa5（）()\\d]{4,30}$/")
			});
			$(".add_insured").click(function(){//添加多模块
				//$("input[name='syrratio']").attr("checked",true);
				var temp = $(this).parent().parent().clone(true);
				if($('#zbjinfo').hasClass('mui-input-group')){
					if($('.mui-input-group').length>5){
						mui.alert('最大受益人只能三位')
						return
					}
				}else if($('#zbjhbjinfo').hasClass('mui-input-group')){
					if($('.mui-input-group').length>5){
						mui.alert('最大受益人只能三位')
						return
					}
				}else {
					if($('.mui-input-group').length>4){
						mui.alert('最大受益人只能三位')
						return
					}
				}
				$(temp).find("div[name='gender']").removeAttr("data-switch");
				$(this).parent().parent().after(temp);
				mui('.mui-switch')['switch']();
				$(this).hide();
				temp.find(".title").addClass("circle_plus");
				/* temp.find(".title").html($(this).text()); */
				//@ylf 受益人信息新增，客户图标的显示
				temp.find("#fadingsyr").parent().remove();
				temp.find(".remove_insured_wrap").show();
				temp.find("input").each(function(){
					$(this).val("");
				})
				temp.find(".card_type").html(JSON.parse(temp.find(".card_type").attr("selectdata"))[0].text);
				temp.find(".card_type").attr("value",JSON.parse(temp.find(".card_type").attr("selectdata"))[0].value);
				temp.find(".select_validity").html("请选择日期");
				//temp.find(".select_validity").removeClass("active");
				temp.find(".select_birthday").html("请选择日期");
				temp.find(".select_birthday ").removeClass("active");
				temp.find(".position").html("请选择省市");
				temp.find(".position").attr("value","");
				temp.find(".job").html("请选择职业");
				temp.find(".job").attr("value","");
				temp.find(".job").attr("data-value","");
				temp.find(".job ").removeClass("active");
				temp.find(".position ").removeClass("active");
				temp.find("input[type='checkbox']").each(function(){
					$(this).prop("checked",false);
				})

				//sjx 2020-01-17添加多受益人时,浙江5级默认删除
				temp.find("div[name='dtown']").remove();
				temp.find("div[name='dcountryside']").remove();




			})

			$(".remove_insured").click(function(){//删除多模块

				//sjx 2020-01-10假如用户增加了三条受益人信息,且是按顺位,当删除第二条受益人信息时,默认把第三条信息全部替换成第二条
				var syrsynpositionB = $(this).parents("form.ssyinfo").find('input[name="syrsynposition"]').prop("checked");
				var syrsynpositionC = $(this).parents("form.ssyinfo").find('div[id="syposition"]').attr("value")
				//if($('.mui-input-group').length==5){
					if(syrsynpositionB == true && syrsynpositionC == "02"){
						//$(temp).find("div[name='gender']").parents("form.ssyinfo").find("div[name='positionnum']").text("第二顺位");
						//$(temp).find("div[name='gender']").parents("form.ssyinfo").find('div[name="positionnum"]').attr("value","02")
						$(this).parents("form.ssyinfo").next().find('div[name="positionnum"]').text("第二顺位");
						$(this).parents("form.ssyinfo").next().find('div[name="positionnum"]').attr("value","02");
						$(this).parents("form.ssyinfo").next().find('div[name="positionnum"]').attr("selectdata",'[{"text":"第二顺位","value":"02"}]');
						var thisClass=$(this).parent().parent().attr("class");
						var nextClass=$(this).parent().parent().next().attr("class");
						if(thisClass!=nextClass){
							$(this).parent().parent().prev().find(".add_insured").show();
						}
						$(this).parent().parent().remove();
					}else{
						var thisClass=$(this).parent().parent().attr("class");
						var nextClass=$(this).parent().parent().next().attr("class");
						if(thisClass!=nextClass){
							$(this).parent().parent().prev().find(".add_insured").show();
						}
						$(this).parent().parent().remove();
					}
				//}




			})


			mui(".mui-content").on("tap",".delete_beneficiary",function(){//删除受益人
				$(this).parents(".beneficiary_form_wrap").remove()
			})


			var whichJobClick = null;
			let zystatus = {'家庭主妇':'T01','保姆及钟点工':'T02','儿童':'T03','退休人员':'T04','自由投资者(需填个人投资问卷）':'Z01','待业人员':'Z02','临时工、无固定职业':'Z03'};
			mui(".mui-content").on("tap",".job",function(){//职业选择框弹出
				$('.mui-loading').show();
				var self=$(this);
				$("input").each(function(){
					if($(this).attr("id") == document.activeElement.id){
						$(this).blur();
					}
				})
				setTimeout(() => {
					$('.mui-loading').hide();
					$(".preview_img_wrap").show();
				}, 500);
				whichJobClick = $(self);
			})
			mui("#c3").on("tap","li",function(){
				whichJobClick.addClass("active");
			});//#career
			$("#c3").on("tap","li",function(){
			    var text=$(this).text();
				var result = zystatus[text];
				if(result == undefined){
					whichJobClick.parent().parent().find("input[id='workUnits']").parent().show();
					whichJobClick.parent().parent().find("div[id='workAddr']").parent().show();
					whichJobClick.parent().parent().find("div[id='workUnits']").parent().show();//被保人单位学校地址
					whichJobClick.parent().parent().find("input[id='dwidposdetail']").parent().show();
					whichJobClick.parent().parent().find("input[id='tbrworkcode']").parent().show();
					whichJobClick.parent().parent().find("input[id='bbrworkcode']").parent().show();
					whichJobClick.parent().parent().find("input[id='syrworkUnits']").parent().show();
					whichJobClick.parent().parent().find("div[id='syrworkAddr']").parent().show();
					whichJobClick.parent().parent().find("input[id='syrworkAddrInfo']").parent().show();
				}else {
					whichJobClick.parent().parent().find("input[id='workUnits']").parent().hide();
					whichJobClick.parent().parent().find("input[id='workUnits']").val('');
					whichJobClick.parent().parent().find("div[id='workAddr']").parent().hide();//投保人单位学校地址
					whichJobClick.parent().parent().find("div[id='workAddr']").text('请选择省市');
					whichJobClick.parent().parent().find("div[id='workAddr']").remove('value');
					whichJobClick.parent().parent().find("div[id='workUnits']").parent().hide();//被保人单位学校地址
					whichJobClick.parent().parent().find("div[id='workUnits']").text('请选择省市');
					whichJobClick.parent().parent().find("div[id='workUnits']").remove('value');
					whichJobClick.parent().parent().find("input[id='dwidposdetail']").parent().hide();
					whichJobClick.parent().parent().find("input[id='dwidposdetail']").val('');
					whichJobClick.parent().parent().find("input[id='tbrworkcode']").parent().hide();
					whichJobClick.parent().parent().find("input[id='tbrworkcode']").val('');
					whichJobClick.parent().parent().find("input[id='bbrworkcode']").parent().hide();
					whichJobClick.parent().parent().find("input[id='bbrworkcode']").val('');
					whichJobClick.parent().parent().find("input[id='syrworkUnits']").parent().hide();
					whichJobClick.parent().parent().find("input[id='syrworkUnits']").val('');
					whichJobClick.parent().parent().find("div[id='syrworkAddr']").parent().hide();
					whichJobClick.parent().parent().find("div[id='syrworkAddr']").html('请选择省市');
					whichJobClick.parent().parent().find("div[id='syrworkAddr']").remove('value');
					whichJobClick.parent().parent().find("input[id='syrworkAddrInfo']").parent().hide();
					whichJobClick.parent().parent().find("input[id='syrworkAddrInfo']").val('');
				}
			    $("#area").val(text);
			    $(".preview_img_wrap,#c2,#c3").hide();
			    whichJobClick.html(text);
			    whichJobClick.attr("jobtype",$(this).attr("jobtype"));
			    whichJobClick.attr("value",$(this).attr("value"));
			    whichJobClick.attr("data-value",$(this).attr("value"));
			});
			mui(".preview_img_wrap").on("tap","p",function(){//职业选择框弹出
				var occname=$(this).html();
				if(occname.indexOf("-&gt;")!=-1){
					occname = occname.substring(occname.lastIndexOf("-&gt;")+5,occname.length);//去掉
				}
				var result = zystatus[occname];
				if(result !== undefined){
					whichJobClick.parent().parent().find("input[id='workUnits']").parent().hide();
					whichJobClick.parent().parent().find("input[id='workUnits']").val('');
					whichJobClick.parent().parent().find("div[id='workAddr']").parent().hide();//投保人单位学校地址
					whichJobClick.parent().parent().find("div[id='workAddr']").text('请选择省市');
					whichJobClick.parent().parent().find("div[id='workAddr']").remove('value');
					whichJobClick.parent().parent().find("div[id='workUnits']").parent().hide();//被保人单位学校地址
					whichJobClick.parent().parent().find("div[id='workUnits']").text('请选择省市');
					whichJobClick.parent().parent().find("div[id='workUnits']").remove('value');
					whichJobClick.parent().parent().find("input[id='dwidposdetail']").parent().hide();
					whichJobClick.parent().parent().find("input[id='dwidposdetail']").val('');
					whichJobClick.parent().parent().find("input[id='tbrworkcode']").parent().hide();
					whichJobClick.parent().parent().find("input[id='tbrworkcode']").val('');
					whichJobClick.parent().parent().find("input[id='bbrworkcode']").parent().hide();
					whichJobClick.parent().parent().find("input[id='bbrworkcode']").val('');
					whichJobClick.parent().parent().find("input[id='syrworkUnits']").parent().hide();
					whichJobClick.parent().parent().find("input[id='syrworkUnits']").val('');
					whichJobClick.parent().parent().find("div[id='syrworkAddr']").parent().hide();
					whichJobClick.parent().parent().find("div[id='syrworkAddr']").html('请选择省市');
					whichJobClick.parent().parent().find("div[id='syrworkAddr']").remove('value');
					whichJobClick.parent().parent().find("input[id='syrworkAddrInfo']").parent().hide();
					whichJobClick.parent().parent().find("input[id='syrworkAddrInfo']").val('');
				}
				whichJobClick.html(occname);
				whichJobClick.addClass("active");
				whichJobClick.attr("data-value",$(this).attr("value"));
				whichJobClick.attr("value",$(this).attr("value"));
				whichJobClick.attr("jobtype",$(this).attr("jobtype"));
				//console.log(whichJobClick.html(),whichJobClick.attr("value"))
				   if(whichJobClick.attr("value")=='T01'||whichJobClick.attr("value")=='T03'||whichJobClick.attr("value")=='O02'){
					   if(whichJobClick.parent().parent().find("input[name='salary']").val()==''){
							whichJobClick.parent().parent().find("input[name='salary']").val(0)
						}
					}else{
						if(whichJobClick.parent().parent().find("input[name='salary']").val()==''||whichJobClick.parent().parent().find("input[name='salary']").val()=='0'){
							whichJobClick.parent().parent().find("input[name='salary']").val('')
						}else{
							var salaryVal =  whichJobClick.parent().parent().find("input[name='salary']").val();
							whichJobClick.parent().parent().find("input[name='salary']").val(salaryVal)
						}
					}

				$(".preview_img_wrap,#career").hide();
				$("#c1").show();
				//console.log(whichJobClick.parent().parent().find("input[name='salary']"))
				$("input[name='search']").blur();
				//职业还原
				/* var occ = "";
				var length = concat.length;
				for(var i=0;i<length;i++){
					occ += '<li class="">'+concat[i].label+'</li>';
				}
				$("#career").html(occ); */

				//搜索框还原
				$("input[name='search']").val("");
			})
			//客户搜索框
			/* var whichCusClick = null; */
			mui(".mui-content").on("tap",".cusinfo",function(){//客户选择框弹出
				if(jysflag=="JYS" && (proCode=='100040'||proCode=='100120'||proCode=='100130'||proCode=='100170'||proCode=='100181' || proCode=='100150' || proCode=='101200')){

					var searchName=$(this).parents("form").find("input[name='name']").val();
					/* mui.alert("建议书转投保带入客户信息不允许修改！");
					return; */
					$("input[name='searchcus']").val(searchName);
					$("input[name='searchcus']").next().hide();
					$("input[name='searchcus']").attr("readOnly","readOnly");
					$("input[name='searchcus']").attr("disabled","disabled");
					var cuslist;
					$.ajax({
						type: 'get',
						url: "/agentwap/customer/customerlistjys.do",
						dataType: "json",
						async: false,
						data: {
							agentCode: getUrlParam('agentCode')
						},
						success: function (data) {
							cuslist = data;
						}
					});
					//console.log(cuslist,888888888)
					var cushtml="";
					try{
						var length = cuslist.preCustomerList.length;
						var listjson=cuslist.preCustomerList;
						//console.log(listjson,11111111)
						for(var i=0;i<length;i++){
							if(listjson[i].name.indexOf(searchText) != -1){
								cushtml+='<li class="mui-table-view-cell"  value="'+listjson[i].id+'">';
								cushtml+='<table style="width: 100%;text-align: center;">';
								cushtml+='<tr>';
								cushtml+='<td style="width:33.33%">'+listjson[i].name+'</td>';
								cushtml+='<td style="width:33.33%">'+listjson[i].mobile+'</td>';
								cushtml+='<td style="width:33.33%">'+listjson[i].credentialTypeName+'</td>';
								cushtml+='</tr>';
								cushtml+='</table>';
								cushtml+='</li>';
							}

						}
					}catch(e){

					}
					if(!cushtml){
						$("#cusinfo").html("抱歉，未查询到当前客户其它可导入的信息！");
					}else{
						$("#cusinfo").html(cushtml);
					}
				}

				var self=$(this);
				$("input").each(function(){
					if($(this).attr("id") == document.activeElement.id){
						$(this).blur();
					}
				})
				$(".cus_img_wrap").show();
				whichCusClick = $(self);
			})


			mui(".cus_img_wrap").on("tap","li",function(){//客户选择框弹出
				$('.country').remove();
				$('.townn').remove();
				$("input[name='ttbr']").prop("checked",false);
				$("input[name='checkbox1']").prop("checked",false);
				var l=$(this).attr("value");

				var cus;
				jQuery.ajax({
					url: "/agentwap/customer/getCustomerInfoById.do",
					data: {
						"customerid": l
					},
					type: "post",
					dataType: 'json',
					async: false,
					success: function (data) {
						cus = data;
					}
				})
				var parentDiv=$(whichCusClick).parents("form");
				//console.log(cus)

				if(cus.locationCode.startsWith('330000')){
					$(parentDiv).find("div[name='dtown']").remove();
					$(parentDiv).find("div[name='dcountryside']").remove();
				    $(parentDiv).find("div[name='position']").attr('value',cus.locationCode).addClass("active");
				    $(parentDiv).find("div[name='position']").html(cus.location);
				    $(parentDiv).find("div[name='position']").parent().after('<div class="mui-input-row dcountryside" name="dcountryside"><label><span></span></label><input type="text" placeholder="请录入村" class="mui-text-right" data-value="countryside" id="countryside" name="countryside" checkrul="/^[\\u4e00-\\u9fa5（）()]{1,30}$|^[\\dA-Za-z_（）()]{10,}$|^[\\dA-Za-z_\\u4e00-\\u9fa5（）()]{1,25}$|^[A-Za-z_\\u4e00-\\u9fa5（）()\\d]{1,30}$/" checktips="投保人村输入有误" maxlength="10" onblur="changeposdetailText(this);"></div>');
				    $(parentDiv).find("div[name='position']").parent().after('<div class="mui-input-row dtown " name="dtown"><label><span></span></label><input type="text" placeholder="请录入镇" class="mui-text-right" data-value="town" id="town" name="town"  checkrul="/^[\\u4e00-\\u9fa5（）()]{1,30}$|^[\\dA-Za-z_（）()]{10,}$|^[\\dA-Za-z_\\u4e00-\\u9fa5（）()]{1,25}$|^[A-Za-z_\\u4e00-\\u9fa5（）()\\d]{1,30}$/" checktips="投保人镇输入有误" maxlength="10" onblur="changeposdetailText(this);"></div>');

				}else{
					$(parentDiv).find('.dtown').hide();
					$(parentDiv).find('.dcountryside').hide();
				}
				 var address = cus.address;
				 //console.log(address)

				if(address.indexOf("-")!=-1){

					var addStr=address.split('-',3);
					var tomVal = addStr[0];
					var countVal = addStr[1];
					var addr = addStr[2];
					$(parentDiv).find("input[name='town']").val(tomVal);
					$(parentDiv).find("input[name='countryside']").val(countVal);
					$(parentDiv).find("input[name='posdetail']").val(addr);
				}else{
					 $(parentDiv).find("input[name='posdetail']").val(address);

				}


				$(parentDiv).find("input[name='name']").val(cus.name);

				/*  if($(parentDiv).find("input[name='name']").val()===$('#tbrname').val()){
					$('#ttbr').prop("checked",true);
				}else{
					$('#ttbr').prop("checked",false);
				} */



				if(cus.mobile!=''){
					$(parentDiv).find("input[name='mobile']").val(cus.mobile);
				}
				/* if(cus.locationCode!=''){
					$(parentDiv).find("div[name='permposition']").html(cus.location);
					var Code=cus.locationCode.replace(new RegExp("-","gm")," ");
					$(parentDiv).find("div[name='permposition']").attr("data-value",Code);
					$(parentDiv).find("div[name='permposition']").attr("value",Code);
					$(parentDiv).find("div[name='permposition']").addClass("active");
				} */

				//console.log(cus,2222)
				//console.log(cus.maritalStatu,111111111)
				if(cus.maritalStatu!=''&&cus.maritalStatu!='-'&&cus.maritalStatu!='null-'){
					//alert(1)
					var maritalStatus=cus.maritalStatu.split("-");
					//console.log(maritalStatus,33333)
				if(cus.customerType=="1"){
					if(maritalStatus[0]=='N'){
						$(parentDiv).find("div[name='maritalStatus']").html('未婚')
						$(parentDiv).find("div[name='maritalStatus']").attr('value','N')

					}
					if(maritalStatus[0]=='Y'){
						$(parentDiv).find("div[name='maritalStatus']").html('已婚')
						$(parentDiv).find("div[name='maritalStatus']").attr('value','Y')
					}
					if(maritalStatus[0]==''){
						$(parentDiv).find("div[name='maritalStatus']").html('请选择')
						$(parentDiv).find("div[name='maritalStatus']").attr('value','')
					}
				}else{
					$(parentDiv).find("div[name='maritalStatus']").html('请选择')
					$(parentDiv).find("div[name='maritalStatus']").attr('value','')
				}
					$(parentDiv).find("div[name='maritalStatus']").addClass("active");
				}else{
					$(parentDiv).find("div[name='maritalStatus']").html('请选择')
					$(parentDiv).find("div[name='maritalStatus']").attr('value','')
					$(parentDiv).find("div[name='maritalStatus']").removeClass("active");
				}

				  if(cus.certValidateEndDate!=''&&cus.customerType=="1"){
					$(parentDiv).find("div[name='certValidateEndDate']").html(cus.certValidateEndDate);
					$(parentDiv).find("div[name='certValidateEndDate']").attr("data-value",cus.certValidateEndDate);
					$(parentDiv).find("div[name='certValidateEndDate']").attr("value",cus.certValidateEndDate);
					$(parentDiv).find("div[name='certValidateEndDate']").addClass("active");
					if(cus.certValidateEndDate=="9999-12-31"){
						$(parentDiv).find("div[name='certValidateEndDate']").parent().find("#longtime").prop("checked",true);
					}
				  }else{
						$(parentDiv).find("div[name='certValidateEndDate']").html("请选择日期");
						$(parentDiv).find("div[name='certValidateEndDate']").attr("data-value","");
						$(parentDiv).find("div[name='certValidateEndDate']").attr("value","");
						$(parentDiv).find("div[name='certValidateEndDate']").removeClass("active");
				  }





				var premAddrCode="";
				var premAddrName="";
				if(cus.premAddrProvince!=''){
					var premAddrProvince=cus.premAddrProvince.split("-");
					premAddrCode+=premAddrProvince[1];
					premAddrName+=premAddrProvince[0];
				}
				if(cus.premAddrCity!=''){
					var premAddrCity=cus.premAddrCity.split("-");
					premAddrCode+=" "+premAddrCity[1];
					premAddrName+=" "+premAddrCity[0];
				}
				if(cus.premAddrCounty!=''){
					var premAddrCounty=cus.premAddrCounty.split("-");
					premAddrCode+=" "+premAddrCounty[1];
					premAddrName+=" "+premAddrCounty[0];
				}
				if($.trim(premAddrCode)&&cus.customerType=="1"){
					$(parentDiv).find("div[name='permposition']").html(premAddrName);
					$(parentDiv).find("div[name='permposition']").attr("data-value",premAddrCode);
					$(parentDiv).find("div[name='permposition']").attr("value",premAddrCode);
					$(parentDiv).find("div[name='permposition']").addClass("active");
				}else{
					$(parentDiv).find("div[name='permposition']").html("请选择");
					$(parentDiv).find("div[name='permposition']").attr("data-value","");
					$(parentDiv).find("div[name='permposition']").attr("value","");
				}
				if(cus.premAddrDetail!=''&&cus.customerType=="1"){
					$(parentDiv).find("input[name='permposdetail']").val(cus.premAddrDetail);
				}


				var contactAddrCode="";
				var contactAddrName="";
				if(cus.contactAddrProvince!=''){
					var contactAddrProvince=cus.contactAddrProvince.split("-");
					contactAddrCode+=contactAddrProvince[1];
					contactAddrName+=contactAddrProvince[0];
				}
				if(cus.contactAddrCity!=''){
					var contactAddrCity=cus.contactAddrCity.split("-");
					contactAddrCode+=" "+contactAddrCity[1];
					contactAddrName+=" "+contactAddrCity[0];
				}
				if(cus.contactAddrCounty!=''){
					var contactAddrCounty=cus.contactAddrCounty.split("-");
					contactAddrCode+=" "+contactAddrCounty[1];
					contactAddrName+=" "+contactAddrCounty[0];

					var postalCode="";
					for(var index=0;index<postCodes.length;index++){
						if(postCodes[index].val==contactAddrCounty[1]){
							postalCode=postCodes[index].postCode;
							break;
						}
					}

					console.log("当前市区邮编是"+postalCode);
					$(parentDiv).find("input[name='postalCode']").val(postalCode);

				}

				//sjx 11-25 19:25新增单位邮编
				var workAddra = $("#workAddr").attr("value");
				if(workAddra != ''){
					if(workAddra === undefined){

					}else{
						var aaa = $("#workAddr").attr("value").split(" ")[1];
						var workpostalCode="";
						for(var index1=0;index1<postCodes.length;index1++){
							if(postCodes[index1].val==aaa){
								workpostalCode=postCodes[index1].postCode;
								break;
							}
						}
						console.log("当前单位邮编是"+workpostalCode);
						$(parentDiv).find("input[name='workpostalCode']").val(workpostalCode);
					}

				}


				if($.trim(contactAddrCode)){
					$(parentDiv).find("div[name='position']").html(contactAddrName);
					$(parentDiv).find("div[name='position']").attr("data-value",contactAddrCode);
					$(parentDiv).find("div[name='position']").attr("value",contactAddrCode);
					$(parentDiv).find("div[name='position']").addClass("active");
				}
				/* if(cus.contactAddrDetail!=''){
					$(parentDiv).find("input[name='posdetail']").val(cus.contactAddrDetail);
				} */
				if(cus.workUnits!=''&&cus.customerType=="1"){
					$(parentDiv).find("input[name='workUnits']").val(cus.workUnits);
				}
				if(cus.notes!=''&&cus.customerType=="1"){
					$(parentDiv).find("input[name='postalCode']").val(cus.notes);
				}
				//sjx 11-25 19:25新增单位邮编
				/* if(cus.notes!=''&&cus.customerType=="1"){
					//$(parentDiv).find("input[name='workpostalCode']").val(cus.notes2);
					$(parentDiv).find("input[name='workpostalCode']").val(cus.notes);
				} */
				if(cus.mobile!=''&&cus.customerType=="1"){
					$(parentDiv).find("input[name='mobile']").val(cus.mobile);
				}
				if(cus.familySalary!=''&cus.customerType=="1"){
					$(parentDiv).find("input[name='familySalary']").val(cus.familySalary);
				}else if(cus.familySalary!=''&cus.customerType=="0"){
					$(parentDiv).find("input[name='familySalary']").val("");
				}
				if(cus.salary!=''&&cus.customerType=="1"){
					if(cus.salary.length>5){
						cus.salary=cus.salary.slice(0,5);
					}
					$(parentDiv).find("input[name='salary']").val(cus.salary);
				}else if(cus.customerType=="0"){
					$(parentDiv).find("input[name='salary']").val("请输入年收入");
				}
				if(cus.height!=''&&cus.customerType=="1"){
					$(parentDiv).find("input[name='height']").val(cus.height);
				}else{
					$(parentDiv).find("input[name='height']").val("请输入身高");
					/* if($(parentDiv).find("input[name='height']").val()=="请输入身高"){
						$(this).css('color','#aaa')
					}
					if($(parentDiv).find("input[name='height']").val()!="请输入身高"){
						$(this).css('color','#333')
					}
					$(parentDiv).find("input[name='height']").bind("input",function(){
						$(this).css('color','#333')
					}) */
				}
				if(cus.weight!=''&&cus.customerType=="1"){
					$(parentDiv).find("input[name='weight']").val(cus.weight);
				}else{
					$(parentDiv).find("input[name='weight']").val("请输入体重");
				}
				if(cus.isOtherSec!=''&&cus.customerType=="1"){
					if(cus.isOtherSec=='0'){
						$(parentDiv).find("div[name='isOtherSec']").addClass("mui-active");
					}else{
						$(parentDiv).find("div[name='isOtherSec']").removeClass("mui-active");
					}
				}
				/* if(cus.maritalStatu!=''&&cus.maritalStatu!='-'&&cus.maritalStatu!='null-'){
					var maritalStatus=cus.maritalStatu.split("-");
					$(parentDiv).find("div[name='maritalStatus']").html(maritalStatus[1]);
					$(parentDiv).find("div[name='maritalStatus']").attr("data-value",maritalStatus[0]);
					$(parentDiv).find("div[name='maritalStatus']").attr("value",maritalStatus[0]);
					$(parentDiv).find("div[name='maritalStatus']").addClass("active");
				} */

				if(cus.careerCode!=''&&cus.customerType=="1"){
					$(parentDiv).find("div[name='career']").html(cus.careerName);
					$(parentDiv).find("div[name='career']").attr("data-value",cus.careerCode);
					$(parentDiv).find("div[name='career']").attr("value",cus.careerCode);
					$(parentDiv).find("div[name='career']").addClass("active");
					$(parentDiv).find("div[name='career']").attr("jobtype",cus.careerType);
				}else if(cus.careerCode!=''&&cus.customerType=="0"){
					$(parentDiv).find("div[name='career']").html("请选择职业");
					$(parentDiv).find("div[name='career']").attr("data-value","");
					$(parentDiv).find("div[name='career']").attr("value","");
					$(parentDiv).find("div[name='career']").removeClass("active");
					$(parentDiv).find("div[name='career']").attr("jobtype","");
				}else if(cus.careerCode ==''){
					$(parentDiv).find("div[name='career']").html('请选择职业');
					/* $(parentDiv).find("div[name='career']").css('color','#999') */
				}
				if(cus.nationality!=''&&cus.nationality!='-'&&cus.nationality!='null-'&&cus.customerType=="1"){
					var nationality=cus.nationality.split("-");
					$(parentDiv).find("div[name='nationality']").html(nationality[1]);
					$(parentDiv).find("div[name='nationality']").attr("data-value",nationality[0]);
					$(parentDiv).find("div[name='nationality']").attr("value",nationality[0]);
					$(parentDiv).find("div[name='nationality']").addClass("active");
				}
				if(cus.birth!=''){
					$(parentDiv).find("div[name='birthDate']").html(cus.birth);
					$(parentDiv).find("div[name='birthDate']").attr("data-value",cus.birth);
					$(parentDiv).find("div[name='birthDate']").attr("value",cus.birth);
					$(parentDiv).find("div[name='birthDate']").addClass("active");
				}
				if(cus.sex!=''){
					if(cus.sex=='0'){
						$(parentDiv).find("div[name='gender']").addClass("mui-active");
					}else{
						$(parentDiv).find("div[name='gender']").removeClass("mui-active");
					}
				}
				if(cus.credentialNo!=''){
					$(parentDiv).find("input[name='certificateNum']").val(cus.credentialNo);

				}
				if(cus.credentialTypeName!=''){
					var TypeValue="";
					$(parentDiv).find("div[name='certificateType']").html(cus.credentialTypeName);
					var cardType=JSON.parse($(parentDiv).find("div[name='certificateType']").attr("selectdata"));
					for(var i=0;i<cardType.length;i++){
						if(cardType[i].text==cus.credentialTypeName){
							$(parentDiv).find("div[name='certificateType']").attr("value",cardType[i].value);
							$(parentDiv).find("div[name='certificateType']").addClass("mui-active");
							TypeValue=cardType[i].value;
						}
					}

					var certType =$(parentDiv).find("div[name='certificateType']").html()
					if(certType =='身份证'){
						 var UUserCard = $(parentDiv).find("input[name='certificateNum']").val();
						 if(UUserCard != null && UUserCard != ''){
						       //获取出生日期
						       	var birthday = UUserCard.slice(6, 10) + "-" +UUserCard.slice(10, 12) + "-" + UUserCard.slice(12, 14);
							      //console.log(birthday,11111111)
						       //获取年龄
						       var myDate = new Date();
						       var month = myDate.getMonth() + 1;
						       var day = myDate.getDate();

						       var age = myDate.getFullYear() - UUserCard.slice(6, 10) - 1;
						       if (UUserCard.slice(10, 12) < month || UUserCard.slice(10, 12) == month && UUserCard.slice(12, 14) <= day) {
						       		age++;
						       }

					       		var res = age;
					       		//console.log(res,3333333)
					       	 if(res<46){
								 $("input[name='checkbox1']").attr('disabled',true);
								 $(parentDiv).find("div[name='certValidateEndDate']").html("请选择日期");
								 $(parentDiv).find("div[name='certValidateEndDate']").css("colr","#999");
							}else{
								$("input[name='checkbox1']").attr('disabled',false);
							}
					       }

					}




					/* if(TypeValue=="1"||TypeValue=="A"){
						$(parentDiv).find("input[name='residentsText']").parent().hide();
					}else{ */
						$(parentDiv).find("input[name='residentsText']").parent().show();
					/* } */
				}

				try{
					if(cus.taxMode!=''&&cus.customerType=="1"){
						$(parentDiv).find("div[name='taxMode']").attr("value",cus.taxMode);
						$(parentDiv).find("div[name='taxMode']").addClass("mui-active");
						var taxModeType=JSON.parse($(parentDiv).find("div[name='taxMode']").attr("selectdata"));
						for(var i=0;i<taxModeType.length;i++){
							if(taxModeType[i].value==cus.taxMode){
								$(parentDiv).find("div[name='taxMode']").html(taxModeType[i].text);
							}
						}

					}
					if(cus.individualMode!=''&&cus.customerType=="1"){
						$(parentDiv).find("div[name='individualMode']").attr("value",cus.individualMode);
						$(parentDiv).find("div[name='individualMode']").addClass("mui-active");
						var individualModeType=JSON.parse($(parentDiv).find("div[name='individualMode']").attr("selectdata"));
						for(var i=0;i<individualModeType.length;i++){
							if(individualModeType[i].value==cus.individualMode){
								$(parentDiv).find("div[name='individualMode']").html(individualModeType[i].text);
							}
						}
					}
				}catch(e){

				}

				if(cus.taxCode!=''&cus.customerType=="1"){
					$(parentDiv).find("input[name='taxCode']").val(cus.taxCode);

				}
				if(cus.taxName!=''&cus.customerType=="1"){
					$(parentDiv).find("input[name='taxName']").val(cus.taxName);

				}
				if(cus.taxpayerCode!=''&cus.customerType=="1"){
					$(parentDiv).find("input[name='taxpayerCode']").val(cus.taxpayerCode);

				}
				if(cus.organizationCode!=''&cus.customerType=="1"){
					$(parentDiv).find("input[name='organizationCode']").val(cus.organizationCode);

				}
				if(cus.socialCode!=''&cus.customerType=="1"){
					$(parentDiv).find("input[name='socialCode']").val(cus.socialCode);

				}
				if(cus.tel!=''&cus.customerType=="1"){
					$(parentDiv).find("input[name='tel']").val(cus.tel);

				}
				var taxableAddrCode="";
				var taxableAddrName="";
				if(cus.taxableAddr!=''&cus.customerType=="1"){
					var taxableAddr=cus.taxableAddr.split("-");
					taxableAddrCode+=taxableAddr[1];
					taxableAddrName+=taxableAddr[0];

				}
				if(cus.taxableAddrCity!=''&cus.customerType=="1"){
					var taxableAddrCity=cus.taxableAddrCity.split("-");
					taxableAddrCode+=" "+taxableAddrCity[1];
					taxableAddrName+=" "+taxableAddrCity[0];

				}

				if($.trim(taxableAddrCode)&&cus.customerType=="1"){
					$(parentDiv).find("div[name='taxableAddr']").html(taxableAddrName);
					$(parentDiv).find("div[name='taxableAddr']").attr("data-value",taxableAddrCode);
					$(parentDiv).find("div[name='taxableAddr']").attr("value",taxableAddrCode);
					$(parentDiv).find("div[name='taxableAddr']").addClass("active");
				}
				if(cus.attachPath!=''&cus.customerType=="1"){
					var partyType=$(parentDiv).attr("id");
					var type="";
					if(partyType=="tbrinfo"){
						type="tbrcard";
					}
					if(partyType=="mbbrinfo"){
						type="mbbrcard";
					}
					/* jQuery.ajax({
						url:"/agentwap/Insurance/CustmoerYxCody.do",
						data:{"path":cus.attachPath,"orderNo":getUrlParam("orderNo"),"fileNames":cus.attachNames,"type":type},
						type:"post",
						dataType:'json',
						async:false,
						success:function(data){
							console.log(data);
						}

					}) */
				}
				$("input[name='searchcus']").blur();
				$(".cus_img_wrap").hide();
				$("input[name='residentsText']").prop("checked",false);
				$("input[name='residentsText']").val("");
				//客户还原
				var cushtml = "";
				var length = cusJson.length;
				for(var i=0;i<length;i++){
					cushtml+='<li class="mui-table-view-cell"  value="'+cusJson[i].id+'">';
					cushtml+='<table style="width: 100%;text-align: center;">';
					cushtml+='<tr>';
					cushtml+='<td style="width:33.33%">'+cusJson[i].name+'</td>';
					cushtml+='<td style="width:33.33%">'+cusJson[i].mobile+'</td>';
					cushtml+='<td style="width:33.33%">'+cusJson[i].credentialTypeName+'</td>';
					cushtml+='</tr>';
					cushtml+='</table>';
					cushtml+='</li>';
				}
				$("#cusinfo").html(cushtml);
				//搜索框还原
				$("input[name='searchcus']").val("");
				//直接选择已承保客户信息,职业及年收入校验
				changeSalaryRemark();



			})
			//ocr
			$(".ocr").on("click",function(){
				var dataType = "";
				var formType = $(this).parents("form").attr("id");
				if(formType=="tbrinfo"){
					dataType = "tbrcard";
				}else if(formType=="ssyinfo"){
					dataType = "benefit";
				}else if(formType="mbbrinfo"){
					dataType ="bbrcard";
				}else if(formType="bbrinfo"){
					dataType ="bbrcard";
				}else{}
				var ele = $('<input class="hidden-input" hidden type="file"  accept="image/*"capture="camera" onchange="javascript:sendimg(this)" style="opacity: 0;filter: alpha(opacity=0);cursor: pointer" data-type="'+dataType+'"/>');
				$(this).before(ele);
				if (!isWeiXin()) {
					if(browser.versions.android || browser.versions.ios){
						var btnArray = ['反面', '正面','取消'];
						mui.confirm('请选择身份证正反面', '提示', btnArray, function(e) {
							if (e.index == 1) {//是//正面
								mobileOcr(ele,"2");
								$(ele).attr("cardType","2");
							}else if(e.index == 0){//反面
								mobileOcr(ele,"3");
								$(ele).attr("cardType","3");
							}
						});
					}else{
						//$(ele).click();
						mui.alert("此型号手机暂不支持ocr识别,请手动录入");
						return;
					}
				}else{
					var btnArray = ['反面', '正面','取消'];
					mui.confirm('请选择身份证正反面', '提示', btnArray, function(e) {
						if (e.index == 1) {//是//正面
							mobileOcr(ele,"2");
							$(ele).attr("cardType","2");
						}else if(e.index == 0){//反面
							mobileOcr(ele,"3");
							$(ele).attr("cardType","3");
						}
					});
				}
				$("input[name='residentsText']").prop("checked",false);
				$("input[name='residentsText']").val("");

			});

			//sjx 2020-01-06 新增受益人同投保人联系地址和同被保人联系地址 2345

			//start
			$("input[name='tongtbraddress']").each(function(){
				//$("input[name='tongtbraddress']").prop("checked")==false
				var flag = $(this).parents("form[id='ssyinfo']").find("input[id='tongtbraddress']").val();
				if(flag == "T"){
					$(this).parents("form[id='ssyinfo']").find("input[name='tongtbraddress']").attr("checked",true);
				}

				$(this).parent().addClass("radio_ctrl mui-checkbox mui-left");
				$(this).parent().css("width","100%");
				$(this).parent().find("label").css("width","100%");
 			});

			$("input[name='tongbbraddress']").each(function(){
				//$("input[name='tongbbraddress']").prop("checked")==false
				var flag = $(this).parents("form[id='ssyinfo']").find("input[id='tongbbraddress']").val();
				if(flag == "B"){
					$(this).parents("form[id='ssyinfo']").find("input[name='tongbbraddress']").attr("checked",true)
				}
				$(this).parent().addClass("radio_ctrl mui-checkbox mui-left mui-checkbox111");
				$(this).parent().css("width","100%");
				$(this).parent().find("label").css("width","100%");
				$(this).parent().css("border","none");
				var tbrnameone = $("form[id='tbrinfo']").find("input[name='name']").val();
				if(tbrnameone != ""){
					//$(this).parent().css("top","-38px");
				}
 			});

			$('input[name="tongbbraddress"]').parent().css("bottom","34px").css("left","170px");


			//为节点加class,为了解决同投被保人联系地址下面空大的问题
			/* $('input[id="tongtbraddress"]').parent().addClass("tongtbraddress_div_class");
			$('div[id="syrloc"]').parent().addClass("syrloc_div_class");
			$('input[id="syrposdetail"]').parent().addClass("syrposdetail_div_class");
			$('input[id="syrworkUnits"]').parent().addClass("syrworkUnits_div_class");
			$('div[id="syrworkAddr"]').parent().addClass("syrworkAddr_div_class");
			$('input[id="syrworkAddrInfo"]').parent().addClass("syrworkAddrInfo_div_class"); */

			$('input[id="ttbr"]').parent().addClass("ttbr_div_class");
			$('input[id="ssrbili"]').parents("form[id='ssyinfo']").find('div[name="relateInsured"]').parent().addClass("relateInsured_div_class");
			$('div[id="syposition"]').parent().addClass("syposition_div_class");
			$('input[id="ssrbili"]').parent().addClass("ssrbili_div_class");
			$('input[id="ssrname"]').parent().addClass("ssrname_div_class");
			$('div[id="sscardtype"]').parent().addClass("sscardtype_div_class");
			$('input[id="ssrcardnum"]').parent().addClass("ssrcardnum_div_class");
			$('div[id="sscarddate"]').parent().addClass("sscarddate_div_class");
			$('input[id="longtime"]').parent().addClass("sslongtime_div_class");
			$('div[id="ssrsex"]').parent().addClass("ssrsex_div_class");
			$('div[id="ssbirday"]').parent().addClass("ssbirday_div_class");
			$('div[id="syrcountry"]').parent().addClass("syrcountry_div_class");
			$('div[id="syrjob"]').parent().addClass("syrjob_div_class");
			$('input[id="syrsalary"]').parent().addClass("syrsalary_div_class");
			$('input[id="syrmobile"]').parent().addClass("syrmobile_div_class");
			$('input[id="tongbbraddress"]').parent().addClass("tongbbraddress_div_class");
			$('input[id="syrsynposition"]').parent().addClass("syrsynposition_div_class");

			//sjx 2020-02-10新增受益人户籍所在地
			//$('div[id="permposition"]').parent().addClass("permposition_div_class");
			$('div[id="sscarddate"]').parents("form.ssyinfo").find('div[id="permposition"]').parent().addClass("permposition_div_class");
			//$(this).parents("form.ssyinfo").find("input[name='earningRatio']")
			//$('div[id="maritalStatus"]').parent().addClass("maritalStatus_div_class");


			$('input[id="tongtbraddress"]').parent().addClass("tongtbraddress_div_class");
			$('div[id="syrloc"]').parent().addClass("syrloc_div_class");
			$('input[id="syrposdetail"]').parent().addClass("syrposdetail_div_class");
			$('input[id="syrworkUnits"]').parent().addClass("syrworkUnits_div_class");
			$('div[id="syrworkAddr"]').parent().addClass("syrworkAddr_div_class");
			$('input[id="syrworkAddrInfo"]').parent().addClass("syrworkAddrInfo_div_class");



			//sjx 2020-01-08新增按顺位和按比例回显
			//start
			//按比例
			$("input[name='syrratio']").each(function(){

				//sjx 2020-01-09新增按比例或者按顺位回显
				if(jsondata[2].objjson[2].text == "S"){
					if($("#fadingsyr").hasClass("mui-active")==true){
						$("[name='syrsynposition']").attr("checked",false);
						$('div[id="syposition"]').parent().css("display","none");
					}else{
						$("[name='syrsynposition']").attr("checked",true);
						$('div[id="syposition"]').parent().css("display","block");
					}
				}else{
					$("[name='syrratio']").attr("checked",true);
				}

				$(this).parent().addClass("radio_ctrl mui-checkbox mui-left");
				$(this).parent().css("width","100%");
				$(this).parent().find("label").css("width","100%");
 			});
			//按顺位
			$("input[name='syrsynposition']").each(function(){
				$("input[name='syrsynposition']").prop("checked")==false
				$(this).parent().addClass("radio_ctrl mui-checkbox mui-left mui-checkbox111");
				$(this).parent().css("width","100%");
				$(this).parent().find("label").css("width","100%");
				$(this).parent().css("border","none");

 			});
			$('input[name="syrsynposition"]').parent().css("bottom","34px").css("left","170px");
			//end

			/* var syrratioFlagtwo = $('input:checkbox[name="syrratio"]:checked').val();
			if(syrratioFlagtwo == "on" || syrratioFlagtwo == ""){
				//默认隐藏受益顺位
				$('div[name="syposition"]').parent().css("display","none");
			} */
			//end

			//页面回显时页面优化
			if(document.getElementById("fadingsyr")!=null){
				 var ssrbili = $('#ssrbili').val();
				 if(ssrbili != '' && ssrbili != null){
					 $('.syrsynposition_div_class').css({'top':'-48px'});
					 $('.tongbbraddress_div_class ').css({'top':'-79px'});
				 }
			}

});


		function changediv(obj){
			var objparent=$(obj).parent().parent();
			if($(objparent).hasClass("beneficiary_form")){
				$(objparent).find("input[name='ttbr']").prop("checked",false);
			}
			if($(obj).hasClass("card_type")){
				if($(obj).attr("value")!='0'){
					/* if($(obj).attr("value")==''){
						$(objparent).find("input[name='checkbox1']").prop("checked",true);
						$(objparent).find("input[name='checkbox1']").prop("disabled",true);
						$(objparent).find("div[name='certValidateEndDate']").html("9999-12-31");
						$(objparent).find("div[name='certValidateEndDate']").removeClass("select_validity");
						$(objparent).find("div[name='certValidateEndDate']").addClass("active");
						$(objparent).find("div[name='certValidateEndDate']").attr("value","9999-12-31");
						$(objparent).find("div[name='certValidateEndDate']").attr("data-value","9999-12-31");
					}else{ */
						//$(objparent).find("input[name='checkbox1']").prop("disabled",false);
						$(objparent).find("input[name='checkbox1']").prop("checked",false);
						$(objparent).find("div[name='certValidateEndDate']").html("请选择日期");
						$(objparent).find("div[name='certValidateEndDate']").addClass("select_validity");
						$(objparent).find("div[name='certValidateEndDate']").removeClass("active");
						$(objparent).find("div[name='certValidateEndDate']").attr("value","");
						$(objparent).find("div[name='certValidateEndDate']").attr("data-value","");
					/* } */
				}else{
					var certificateNum=$(objparent).find("input[name='certificateNum']");
					/* $(objparent).find("input[name='checkbox1']").prop("checked",false);
					$(objparent).find("div[name='certValidateEndDate']").html("请选择日期");
					$(objparent).find("div[name='certValidateEndDate']").addClass("select_validity");
					$(objparent).find("div[name='certValidateEndDate']").removeClass("active");
					$(objparent).find("div[name='certValidateEndDate']").attr("value","");
					$(objparent).find("div[name='certValidateEndDate']").attr("data-value","");
					$(objparent).find("input[name='checkbox1']").prop("disabled",false); */
					$(certificateNum).blur();
				}
			}

		}

//职业显示
(function($){
	var concat = [{"value":"一般","label":"一般","children":[{"value":"机关团体","label":"机关团体","children":[{"value":"A00","level":"1","label":"内勤人员（公职人员）"},{"value":"A01","level":"1","label":"内勤人员（非公职人员）"}]},{"value":"公司行号","label":"公司行号","children":[{"value":"A02","level":"2","label":"外勤人员(从事联系工作)"},{"value":"A03","level":"1","label":"长生人寿营销人员"}]}]},{"value":"农牧业","label":"农牧业","children":[{"value":"农业","label":"农业","children":[{"value":"B01","level":"1","label":"农场经营者(不亲自作业)"},{"value":"B02","level":"2","label":"农夫"},{"value":"B03","level":"3","label":"长短工"},{"value":"B04","level":"3","label":"果农"},{"value":"B05","level":"2","label":"苗圃栽培人员"},{"value":"B06","level":"2","label":"花圃栽培人员"},{"value":"B07","level":"2","label":"饲养家禽家畜人员"},{"value":"B08","level":"2","label":"农业技师"},{"value":"B09","level":"3","label":"农业机械的操作或修护人员"},{"value":"B10","level":"2","label":"农具商"}]},{"value":"牧业","label":"牧业","children":[{"value":"B11","level":"1","label":"畜牧场经营者(不亲自作业)"},{"value":"B12","level":"3","label":"畜牧工作人员"},{"value":"B13","level":"3","label":"兽医"}]}]},{"value":"渔业","label":"渔业","children":[{"value":"内陆渔业","label":"内陆渔业","children":[{"value":"C01","level":"1","label":"渔场经营者(不亲自作业)"},{"value":"C02","level":"3","label":"渔场经营者(亲自作业)"},{"value":"C03","level":"3","label":"养殖工人(内陆)"},{"value":"C04","level":"4","label":"养殖工人(沿海)"},{"value":"C05","level":"2","label":"水族馆经营者"},{"value":"C06","level":"4","label":"捕渔人(内陆)"},{"value":"C07","level":"D","label":"捕渔人(沿海)"},{"value":"C08","level":"1","label":"水产实验人员(室内)"}]},{"value":"海上渔业","label":"海上渔业","children":[{"value":"C09","level":"D","label":"远洋渔船船员"},{"value":"C10","level":"D","label":"近洋渔船船员"}]},{"value":"水产公司","label":"水产公司","children":[{"value":"C11","level":"2","label":"营业员"},{"value":"C12","level":"1","label":"经理人员"},{"value":"C13","level":"4","label":"搬运工"}]}]},{"value":"木材森林业","label":"木材森林业","children":[{"value":"森林砍伐业","label":"森林砍伐业","children":[{"value":"D01","level":"4","label":"领班"},{"value":"D02","level":"4","label":"监工"},{"value":"D03","level":"D","label":"伐木工人"},{"value":"D04","level":"D","label":"锯木工人"},{"value":"D05","level":"D","label":"运材车辆的司机及押运人员"},{"value":"D06","level":"D","label":"起重机的操作人员"},{"value":"D07","level":"D","label":"装运工人"},{"value":"D08","level":"D","label":"挂钩人"}]},{"value":"木材加工业 ","label":"木材加工业 ","children":[{"value":"D09","level":"2","label":"木材工厂的现场职员"},{"value":"D10","level":"3","label":"领班"},{"value":"D11","level":"3","label":"分级员"},{"value":"D12","level":"3","label":"检查员"},{"value":"D13","level":"3","label":"标记员"},{"value":"D14","level":"3","label":"磅秤员"},{"value":"D15","level":"4","label":"锯木工人"},{"value":"D16","level":"4","label":"防腐剂工人"},{"value":"D17","level":"4","label":"木材储藏槽工人"},{"value":"D18","level":"4","label":"木材搬运工人"},{"value":"D19","level":"4","label":"吊车操作人员"},{"value":"D20","level":"4","label":"合板制造人员"},{"value":"D21","level":"4","label":"仓库管理员"},{"value":"D22","level":"2","label":"木材供应站管理人员"},{"value":"D23","level":"3","label":"木材供应站营业员"}]},{"value":"造林业","label":"造林业","children":[{"value":"D24","level":"3","label":"领班"},{"value":"D25","level":"4","label":"山地造林工人"},{"value":"D26","level":"4","label":"山林管理人员"},{"value":"D27","level":"D","label":"森林防火人员"},{"value":"D28","level":"2","label":"平地育苗工人"},{"value":"D29","level":"1","label":"实验室育苗栽培人员"}]}]},{"value":"矿业采石业 ","label":"矿业采石业 ","children":[{"value":"坑内作业 ","label":"坑内作业 ","children":[{"value":"E01","level":"D","label":"矿工"}]},{"value":"坑外作业 ","label":"坑外作业 ","children":[{"value":"E02","level":"2","label":"经营者(不到现场者)"},{"value":"E03","level":"4","label":"经营者(现场监督者)"},{"value":"E04","level":"2","label":"经理人员"},{"value":"E05","level":"4","label":"矿业工程师、技师、领班"},{"value":"E06","level":"D","label":"工人"},{"value":"E07","level":"4","label":"工矿安全人员"}]},{"value":"海上作业 ","label":"海上作业 ","children":[{"value":"E08","level":"D","label":"潜水人员"},{"value":"E09","level":"D","label":"其他作业人员"}]},{"value":"采砂石业 ","label":"采砂石业 ","children":[{"value":"E10","level":"4","label":"采石业工人"},{"value":"E11","level":"4","label":"采砂业工人"}]},{"value":"陆上油矿开采业","label":"陆上油矿开采业","children":[{"value":"E12","level":"2","label":"行政人员"},{"value":"E13","level":"3","label":"工程师"},{"value":"E14","level":"D","label":"技术员"},{"value":"E15","level":"D","label":"油气井清洁保养修护工"},{"value":"E16","level":"D","label":"钻勘设备安装换修保养工"},{"value":"E17","level":"D","label":"钻油井工人"}]}]},{"value":"交通运输业 ","label":"交通运输业 ","children":[{"value":"陆运","label":"陆运","children":[{"value":"F01","level":"1","label":"计程车行、货运行负责人(不参与驾驶)"},{"value":"F02","level":"2","label":"外务员"},{"value":"F03","level":"1","label":"内勤工作人员"},{"value":"F04","level":"2","label":"自用小客车司机(包括小轿车，11座以内的面包车)"},{"value":"F05","level":"4","label":"自用大客车司机"},{"value":"F06","level":"4","label":"计程车司机"},{"value":"F07","level":"4","label":"游览车司机及服务员"},{"value":"F08","level":"4","label":"客运车司机及服务员"},{"value":"F09","level":"4","label":"小型客货两用车司机"},{"value":"F10","level":"4","label":"自用货车司机、随车工人、小型自用货车司机"},{"value":"F11","level":"4","label":"人力三轮车夫"},{"value":"F12","level":"D","label":"铁牛车(拼装车)驾驶员"},{"value":"F13","level":"3","label":"救护车驾驶员"},{"value":"F14","level":"D","label":"机动三轮车司机及助手"},{"value":"F15","level":"1","label":"柜台售票员"},{"value":"F16","level":"2","label":"客运车稽核人员"},{"value":"F17","level":"D","label":"营业用货车司机(4吨及4吨以上)"},{"value":"F18","level":"4","label":"营业用货车司机(4吨以下)"},{"value":"F19","level":"D","label":"营业用货车随车工人(4吨及4吨以上)"},{"value":"F20","level":"4","label":"营业用货车随车工人(4吨以下)"},{"value":"F21","level":"4","label":"搬运工人"},{"value":"F22","level":"D","label":"砂石车司机、随车工人"},{"value":"F23","level":"D","label":"工程卡车司机、随车工人"},{"value":"F24","level":"D","label":"液化、气化油罐车随车司机,随车工人"},{"value":"F25","level":"4","label":"货柜车司机、随车工人"},{"value":"F26","level":"4","label":"缆车操作员"},{"value":"F27","level":"4","label":"拖吊车驾驶及工作人员"}]},{"value":"铁路","label":"铁路","children":[{"value":"F28","level":"1","label":"站长"},{"value":"F29","level":"1","label":"票房工作人员"},{"value":"F30","level":"1","label":"播音员"},{"value":"F31","level":"1","label":"一般内勤人员"},{"value":"F32","level":"1","label":"车站剪票员"},{"value":"F33","level":"1","label":"服务台人员"},{"value":"F34","level":"2","label":"月台工作人员"},{"value":"F35","level":"3","label":"行李搬运工人"},{"value":"F36","level":"2","label":"车站清洁工人"},{"value":"F37","level":"2","label":"随车人员(技术员除外)"},{"value":"F38","level":"3","label":"驾驶员"},{"value":"F39","level":"3","label":"燃料填充员"},{"value":"F40","level":"4","label":"机工"},{"value":"F41","level":"4","label":"电工"},{"value":"F42","level":"1","label":"修护厂厂长"},{"value":"F43","level":"1","label":"修护厂一般内勤人员"},{"value":"F44","level":"2","label":"修护厂工程师"},{"value":"F45","level":"4","label":"修护厂技工"},{"value":"F46","level":"4","label":"修路工"},{"value":"F47","level":"4","label":"铁路维护工"},{"value":"F48","level":"2","label":"平交道看守人员"},{"value":"F49","level":"3","label":"铁路货运：领班"},{"value":"F50","level":"4","label":"铁路货运：搬运工人"}]},{"value":"航运","label":"航运","children":[{"value":"G01","level":"D","label":"船长"},{"value":"G02","level":"D","label":"轮机长"},{"value":"G03","level":"D","label":"大副"},{"value":"G04","level":"D","label":"二副"},{"value":"G05","level":"D","label":"三副"},{"value":"G06","level":"D","label":"大管轮"},{"value":"G07","level":"D","label":"二管轮"},{"value":"G08","level":"D","label":"三管轮"},{"value":"G09","level":"D","label":"报务员"},{"value":"G10","level":"D","label":"事务长"},{"value":"G11","level":"D","label":"医务人员"},{"value":"G12","level":"D","label":"水手长"},{"value":"G13","level":"D","label":"水手"},{"value":"G14","level":"D","label":"铜匠"},{"value":"G15","level":"D","label":"木匠"},{"value":"G16","level":"D","label":"泵匠"},{"value":"G17","level":"D","label":"电机师"},{"value":"G18","level":"D","label":"厨师"},{"value":"G19","level":"D","label":"服务生"},{"value":"G20","level":"D","label":"实习生"},{"value":"G21","level":"D","label":"游览船驾驶员及工作人员"},{"value":"G22","level":"D","label":"小汽艇驾驶员及工作人员"},{"value":"G23","level":"4","label":"码头工人及领班(陆上作业)"},{"value":"G24","level":"D","label":"码头工人及领班(上船作业)"},{"value":"G25","level":"D","label":"吊车操作员"},{"value":"G26","level":"4","label":"堆高机操作员"},{"value":"G27","level":"3","label":"仓库管理人"},{"value":"G28","level":"4","label":"领航员"},{"value":"G29","level":"4","label":"引水人"},{"value":"G30","level":"2","label":"关务人员"},{"value":"G31","level":"3","label":"稽查人员"},{"value":"G32","level":"4","label":"缉私人员"},{"value":"G33","level":"4","label":"拖船驾驶员及工作人员"},{"value":"G34","level":"4","label":"渡轮驾驶员及工作人员"},{"value":"G35","level":"D","label":"垃圾船工作人员"},{"value":"G36","level":"D","label":"救难船员"}]},{"value":"空运","label":"空运","children":[{"value":"G37","level":"1","label":"服务台人员"},{"value":"G38","level":"1","label":"一般内勤人员"},{"value":"G39","level":"1","label":"塔台工作人员"},{"value":"G40","level":"1","label":"关务人员"},{"value":"G41","level":"1","label":"检查人员"},{"value":"G42","level":"1","label":"运务人员"},{"value":"G43","level":"3","label":"缉私人员"},{"value":"G44","level":"2","label":"站内清洁工人"},{"value":"G45","level":"3","label":"机场内交通车司机"},{"value":"G46","level":"4","label":"行李货运搬运工人"},{"value":"G47","level":"4","label":"加添燃料员"},{"value":"G48","level":"4","label":"飞机洗刷人员"},{"value":"G49","level":"4","label":"清洁工(非高处作业)"},{"value":"G50","level":"D","label":"清洁工(高处作业)"},{"value":"G51","level":"4","label":"跑道维护工"},{"value":"G52","level":"4","label":"机械员"},{"value":"G53","level":"4","label":"飞机修护人员"},{"value":"G54","level":"1","label":"办事处人员"},{"value":"G55","level":"1","label":"票务人员"},{"value":"G56","level":"1","label":"机场柜台人员"},{"value":"G57","level":"2","label":"清舱员"},{"value":"G58","level":"1","label":"一般内勤人员"},{"value":"G59","level":"2","label":"外务员"},{"value":"G60","level":"2","label":"报关人员"},{"value":"G61","level":"3","label":"理货员"},{"value":"G62","level":"4","label":"国外航线民航机飞行人员及服务员"},{"value":"G63","level":"4","label":"国内航线民航机飞行人员及服务员"},{"value":"G64","level":"D","label":"直升机飞行员"},{"value":"G65","level":"D","label":"航空公司飞行训练学员"},{"value":"G66","level":"1","label":"站长"},{"value":"G67","level":"1","label":"播音员"},{"value":"G68","level":"D","label":"灯塔修理员"}]}]},{"value":"餐旅业","label":"餐旅业","children":[{"value":"餐旅业","label":"餐旅业","children":[{"value":"H01","level":"1","label":"一般内勤人员"},{"value":"H02","level":"2","label":"外务员"},{"value":"H03","level":"2","label":"导游"},{"value":"H04","level":"1","label":"负责人"},{"value":"H05","level":"1","label":"一般内勤服务员"},{"value":"H06","level":"1","label":"收银员"},{"value":"H07","level":"3","label":"技工"},{"value":"H08","level":"1","label":"经理人员"},{"value":"H09","level":"1","label":"一般内勤工作人员"},{"value":"H10","level":"1","label":"柜台人员"},{"value":"H11","level":"2","label":"采购人员"},{"value":"H12","level":"2","label":"厨师(大酒店)"},{"value":"H13","level":"4","label":"厨师(饭店、酒楼)"},{"value":"H14","level":"2","label":"服务人员"},{"value":"H15","level":"2","label":"厨师长"},{"value":"H16","level":"2","label":"点心师、配菜师"}]}]},{"value":"建筑工程业 ","label":"建筑工程业 ","children":[{"value":"建筑公司","label":"建筑公司","children":[{"value":"I01","level":"1","label":"建筑师"},{"value":"I02","level":"1","label":"制图员"},{"value":"I03","level":"1","label":"内勤工作人员"},{"value":"I04","level":"3","label":"测量员"},{"value":"I05","level":"3","label":"工程员"},{"value":"I06","level":"3","label":"监工"},{"value":"I07","level":"2","label":"业务员"},{"value":"I08","level":"2","label":"引导参观工地及工地服务人员"},{"value":"I09","level":"1","label":"负责人(不亲自作业,不在现场)"},{"value":"I10","level":"2","label":"负责人(不亲自作业,偶而至工地指导)"},{"value":"I11","level":"3","label":"负责人(实际监工,领班或亲自参与建筑工作者)"},{"value":"I12","level":"3","label":"领班"},{"value":"I13","level":"4","label":"模板工"},{"value":"I14","level":"4","label":"木匠"},{"value":"I15","level":"4","label":"泥水匠、油漆工、水电工(非高处作业)"},{"value":"I16","level":"D","label":"泥水匠、油漆工、水电工(高处作业)"},{"value":"I17","level":"4","label":"混凝土混合机操作员"},{"value":"I18","level":"D","label":"钢骨结构工人"},{"value":"I19","level":"D","label":"鹰架架设工人"},{"value":"I20","level":"D","label":"焊工"},{"value":"I21","level":"D","label":"建筑工程车辆驾驶员"},{"value":"I22","level":"D","label":"建筑工程车辆机械操作员(用机械手操作等)"},{"value":"I23","level":"3","label":"承包商(土木建筑)"},{"value":"I24","level":"4","label":"磨石工人"},{"value":"I25","level":"4","label":"洗石工人"},{"value":"I26","level":"4","label":"石棉瓦或浪板安装工人、铝门窗装修人员(非高处作业)"},{"value":"I27","level":"D","label":"石棉瓦或浪板安装工人、铝门窗装修人员(高处作业)"},{"value":"I28","level":"4","label":"排水工程人员、"},{"value":"I29","level":"3","label":"仓库管理员"}]},{"value":"铁路道路铺设","label":"铁路道路铺设","children":[{"value":"I30","level":"3","label":"工程师"},{"value":"I31","level":"3","label":"领班、监工"},{"value":"I32","level":"4","label":"道路工程机械操作员(压土机、推土机)"},{"value":"I33","level":"4","label":"道路工程车辆驾驶员"},{"value":"I34","level":"D","label":"山地铺设工人"},{"value":"I35","level":"4","label":"平地铺设工人"},{"value":"I36","level":"4","label":"维护工人"},{"value":"I37","level":"D","label":"电线架设及维护工人"},{"value":"I38","level":"4","label":"管道铺设及维护工人"},{"value":"I39","level":"D","label":"高速公路工程人员(含美化工程)"}]},{"value":"造修船业","label":"造修船业","children":[{"value":"I40","level":"3","label":"工程师"},{"value":"I41","level":"4","label":"领班、监工"},{"value":"I42","level":"D","label":"工人"}]},{"value":"电梯升降梯","label":"电梯升降梯","children":[{"value":"I43","level":"4","label":"安装工人(非高处作业)"},{"value":"I44","level":"D","label":"安装工人(高处作业)"},{"value":"I45","level":"4","label":"修理及维护工人"},{"value":"I46","level":"2","label":"操作员(不包括矿场使用者)"}]},{"value":"装璜业","label":"装璜业","children":[{"value":"I47","level":"1","label":"设计制图人员"},{"value":"I48","level":"2","label":"地毯装设人员"},{"value":"I49","level":"4","label":"室内装璜人员"},{"value":"I50","level":"4","label":"室外装璜人员(非高处作业)"},{"value":"I51","level":"D","label":"室外装璜人员(高处作业)"},{"value":"I52","level":"2","label":"承包商、监工"}]},{"value":"其他","label":"其他","children":[{"value":"I53","level":"4","label":"地质探测员(山区、海上)"},{"value":"I54","level":"2","label":"地质探测员(平地)"},{"value":"I55","level":"4","label":"工地看守员"},{"value":"I56","level":"D","label":"海湾港口工程人员"},{"value":"I57","level":"D","label":"水坝工程人员"},{"value":"I58","level":"D","label":"桥梁工程人员"},{"value":"I59","level":"D","label":"隧道、地铁工程人员"},{"value":"I60","level":"D","label":"潜水工作人员"},{"value":"I61","level":"D","label":"爆破工作人员"},{"value":"I62","level":"D","label":"挖泥船工人"},{"value":"I63","level":"4","label":"寺庙彩绘人员"}]}]},{"value":"制造业","label":"制造业","children":[{"value":"钢铁业","label":"钢铁业","children":[{"value":"J01","level":"1","label":"负责人(不亲自作业，不在现场)"},{"value":"J02","level":"2","label":"负责人(不亲自作业,偶而至工地指导)；"},{"value":"J03","level":"3","label":"负责人(实际监工,领班或亲自参与建筑工作者)"},{"value":"J04","level":"4","label":"技师"},{"value":"J05","level":"3","label":"工程师"},{"value":"J06","level":"3","label":"领班、监工"},{"value":"J07","level":"D","label":"工人、制模工"},{"value":"J08","level":"3","label":"车间主任"},{"value":"J09","level":"2","label":"车间统计员"},{"value":"J10","level":"4","label":"仓库管理员"},{"value":"J11","level":"3","label":"检验员"},{"value":"J12","level":"D","label":"搬运工(钢铁，建材等)"}]},{"value":"钢铁工厂机械厂","label":"钢铁工厂机械厂","children":[{"value":"J13","level":"3","label":"领班"},{"value":"J14","level":"4","label":"板金工"},{"value":"J15","level":"4","label":"装配工"},{"value":"J16","level":"D","label":"焊接工"},{"value":"J17","level":"4","label":"车床工(全自动)"},{"value":"J18","level":"D","label":"车床工(其他)"},{"value":"J19","level":"D","label":"铸造工"},{"value":"J20","level":"D","label":"锅炉工"},{"value":"J21","level":"4","label":"水电工"},{"value":"J22","level":"4","label":"铅字铸造工"},{"value":"J23","level":"D","label":"钢铁工厂工人"},{"value":"J24","level":"D","label":"机械厂工人"},{"value":"J25","level":"4","label":"电镀工"},{"value":"J26","level":"D","label":"铣床工"},{"value":"J27","level":"D","label":"剪床工"},{"value":"J28","level":"D","label":"冲床工"},{"value":"J29","level":"4","label":"钳工"},{"value":"J30","level":"D","label":"钻床工"},{"value":"J31","level":"4","label":"铲车工"},{"value":"J32","level":"4","label":"行车司机"},{"value":"J33","level":"D","label":"行车指挥人员"}]},{"value":"电子业","label":"电子业","children":[{"value":"J34","level":"2","label":"工程师"},{"value":"J35","level":"2","label":"技师"},{"value":"J36","level":"2","label":"领班、监工"},{"value":"J37","level":"2","label":"装配工、操作自动I.C.制作人员"},{"value":"J38","level":"3","label":"修理工"},{"value":"J39","level":"2","label":"包装工人"},{"value":"J40","level":"4","label":"制造工"},{"value":"J41","level":"2","label":"点焊工"}]},{"value":"电机业","label":"电机业","children":[{"value":"J42","level":"3","label":"工程师"},{"value":"J43","level":"4","label":"技师"},{"value":"J44","level":"3","label":"领班、监工"},{"value":"J45","level":"4","label":"空调的装修人员(非高处作业)"},{"value":"J46","level":"D","label":"空调的装修人员(高处作业)"},{"value":"J47","level":"D","label":"有关高压电的工作人员"},{"value":"J48","level":"4","label":"冷冻修理工"},{"value":"J49","level":"4","label":"电机调试员"}]},{"value":"家电制造业","label":"家电制造业","children":[{"value":"J50","level":"3","label":"技师"},{"value":"J51","level":"4","label":"一般制造工人"},{"value":"J52","level":"3","label":"装配工"},{"value":"J53","level":"3","label":"包装工"},{"value":"J54","level":"D","label":"铣床工"},{"value":"J55","level":"D","label":"剪床工"},{"value":"J56","level":"D","label":"冲床工"},{"value":"J57","level":"D","label":"焊接工"},{"value":"J58","level":"D","label":"铸造工"},{"value":"J59","level":"4","label":"车床工（全自动）"},{"value":"J60","level":"D","label":"车床工（其他）"},{"value":"J61","level":"2","label":"家电维修"},{"value":"J62","level":"2","label":"检验员"},{"value":"J63","level":"3","label":"仓库管理员"}]},{"value":"塑胶, 橡胶业","label":"塑胶, 橡胶业","children":[{"value":"J64","level":"2","label":"工程师"},{"value":"J65","level":"3","label":"技师"},{"value":"J66","level":"2","label":"领班、监工"},{"value":"J67","level":"3","label":"一般工人"},{"value":"J68","level":"3","label":"塑胶射出成型工人(自动)"},{"value":"J69","level":"4","label":"塑胶射出成型工人(其他)"},{"value":"J70","level":"2","label":"检验员"}]},{"value":"水泥业","label":"水泥业","children":[{"value":"J71","level":"2","label":"工程师"},{"value":"J72","level":"4","label":"技师"},{"value":"J73","level":"3","label":"领班、监工"},{"value":"J74","level":"4","label":"工人"},{"value":"J75","level":"D","label":"采掘工"},{"value":"J76","level":"D","label":"爆破工"},{"value":"J77","level":"D","label":"石棉瓦工人、作业者"}]},{"value":"化学原料业","label":"化学原料业","children":[{"value":"K01","level":"2","label":"工程师"},{"value":"K02","level":"3","label":"技师及实验室工作人员"},{"value":"K03","level":"4","label":"一般工人"},{"value":"K04","level":"D","label":"硫酸、盐酸、硝酸制造工"},{"value":"K05","level":"3","label":"电池制造(技师)"},{"value":"K06","level":"4","label":"电池制造(工人)"},{"value":"K07","level":"D","label":"液化气体制造工"},{"value":"K08","level":"3","label":"仓库管理人员"}]},{"value":"炸药业 ","label":"炸药业 ","children":[{"value":"K09","level":"D","label":"火药爆炸品制造及处理人员(包括爆竹、烟火制造工)"},{"value":"K10","level":"D","label":"矿场采石"}]},{"value":"车辆制造修理业","label":"车辆制造修理业","children":[{"value":"K11","level":"2","label":"工程师"},{"value":"K12","level":"3","label":"技师"},{"value":"K13","level":"4","label":"制造工人(汽、机车)"},{"value":"K14","level":"3","label":"制造工人(自行车)"},{"value":"K15","level":"4","label":"修理保养工人(汽、机车)"},{"value":"K16","level":"3","label":"修理保养工人(自行车）"},{"value":"K17","level":"2","label":"领班、监工"},{"value":"K18","level":"4","label":"试车人员"}]},{"value":"纺织印染及成衣业","label":"纺织印染及成衣业","children":[{"value":"K19","level":"2","label":"工程师"},{"value":"K20","level":"1","label":"设计师"},{"value":"K21","level":"2","label":"技师"},{"value":"K22","level":"2","label":"裁缝"},{"value":"K23","level":"3","label":"制造工人"},{"value":"K24","level":"3","label":"染整工人"},{"value":"K25","level":"2","label":"领班"},{"value":"K26","level":"2","label":"质检员"},{"value":"K27","level":"4","label":"制鞋工"}]},{"value":"床垫及枕头制造业","label":"床垫及枕头制造业","children":[{"value":"K28","level":"1","label":"负责行政工作(经理、文员)"},{"value":"K29","level":"4","label":"切棉、压边、锯工、椅垫工人及其他熟练工人"},{"value":"K30","level":"4","label":"吹气、毛毡、填料、机械操作、堆棉"},{"value":"K31","level":"4","label":"暴露于尘埃或有毒化合物工人"}]},{"value":"造纸工业","label":"造纸工业","children":[{"value":"K32","level":"3","label":"技师"},{"value":"K33","level":"3","label":"监工"},{"value":"K34","level":"4","label":"造纸厂工人"},{"value":"K35","level":"4","label":"纸箱厂工人"}]},{"value":"石棉制造业 ","label":"石棉制造业 ","children":[{"value":"K36","level":"4","label":"管工、督察、工人"},{"value":"K37","level":"3","label":"技师"},{"value":"K38","level":"3","label":"领班、监工"}]},{"value":"家俱制造业 ","label":"家俱制造业 ","children":[{"value":"K39","level":"4","label":"木制家俱制造工人"},{"value":"K40","level":"4","label":"木制家俱修理工"},{"value":"K41","level":"4","label":"金属家俱制造工人"},{"value":"K42","level":"4","label":"金属家俱修理工"},{"value":"K43","level":"D","label":"机木工"}]},{"value":"玻璃及镜片制造业","label":"玻璃及镜片制造业","children":[{"value":"K44","level":"1","label":"负责行政工作(独资业权人、经理、文员、零售商)"},{"value":"K45","level":"4","label":"吹或切玻璃工人,压边工人,上色工人磨光工人,烧玻璃熔炉工人或技师"}]},{"value":"手工艺品业","label":"手工艺品业","children":[{"value":"K46","level":"2","label":"竹木制手工艺品的加工工人"},{"value":"K47","level":"2","label":"竹木制手工艺品的雕刻工人"},{"value":"K48","level":"3","label":"金属手工艺品的加工工人"},{"value":"K49","level":"3","label":"金属手工艺品的雕刻工人"},{"value":"K50","level":"1","label":"布类纸品工艺品的加工工人"},{"value":"K51","level":"3","label":"矿石手工艺品加工人员"}]},{"value":"陶器工业","label":"陶器工业","children":[{"value":"K52","level":"4","label":"工人(长石磨工及挑选、燧石、货仓工人、其他熟练工人)"},{"value":"K53","level":"4","label":"用喷沙器切割玻璃工人"}]},{"value":"电线电缆业","label":"电线电缆业","children":[{"value":"K54","level":"3","label":"技师"},{"value":"K55","level":"4","label":"工人"}]},{"value":"肥皂及洗洁精制造业","label":"肥皂及洗洁精制造业","children":[{"value":"K56","level":"1","label":"负责行政工作(经理、主任、文员)"},{"value":"K57","level":"4","label":"熟练及普通工人"},{"value":"K58","level":"4","label":"于有毒化合物环境中工作的工人"}]},{"value":"食品饮料制造加工业","label":"食品饮料制造加工业","children":[{"value":"K59","level":"3","label":"冰块制造"},{"value":"K60","level":"2","label":"技师"},{"value":"K61","level":"3","label":"制造工人"},{"value":"K62","level":"3","label":"碾米厂操作人员"},{"value":"K63","level":"2","label":"仓库管理员"},{"value":"K64","level":"2","label":"一般食品包装工人"},{"value":"K65","level":"3","label":"冷冻食品包装工人"}]},{"value":"烟草制造业","label":"烟草制造业","children":[{"value":"K66","level":"1","label":"负责行政工作(经理、主任、文员)"},{"value":"K67","level":"4","label":"熟练工人、机器操作员"}]},{"value":"生物制品业","label":"生物制品业","children":[{"value":"K68","level":"3","label":"一般操作工"},{"value":"K69","level":"2","label":"实验人员"}]},{"value":"制药厂","label":"制药厂","children":[{"value":"K70","level":"3","label":"一般操作工人"},{"value":"K71","level":"2","label":"实验人员"}]},{"value":"文具制造业","label":"文具制造业","children":[{"value":"K72","level":"4","label":"一般操作工人"},{"value":"K73","level":"3","label":"装配工"},{"value":"K74","level":"2","label":"检验工"},{"value":"K75","level":"2","label":"出纳"}]},{"value":"纺织业、印染业 ","label":"纺织业、印染业 ","children":[{"value":"K76","level":"2","label":"质量检验员"},{"value":"K77","level":"2","label":"领班,监工"}]},{"value":"灯泡制造业","label":"灯泡制造业","children":[{"value":"K78","level":"2","label":"生产管理员"}]},{"value":"原子核开发核工程","label":"原子核开发核工程","children":[{"value":"K79","level":"4","label":"技术员"},{"value":"K80","level":"3","label":"工程师"}]}]},{"value":"新闻广告业","label":"新闻广告业","children":[{"value":"新闻业、杂志业 ","label":"新闻业、杂志业 ","children":[{"value":"L01","level":"1","label":"内勤人员"},{"value":"L02","level":"2","label":"外勤记者"},{"value":"L03","level":"2","label":"摄影记者"},{"value":"L04","level":"D","label":"战地记者"},{"value":"L05","level":"2","label":"推销员"},{"value":"L06","level":"2","label":"排版工"},{"value":"L07","level":"3","label":"装订工"},{"value":"L08","level":"3","label":"印刷工"},{"value":"L09","level":"3","label":"送货员"},{"value":"L10","level":"3","label":"送报员"}]},{"value":"广告业 ","label":"广告业 ","children":[{"value":"L11","level":"1","label":"一般内勤人员"},{"value":"L12","level":"2","label":"业务员"},{"value":"L13","level":"2","label":"广告影片的拍摄录制人员"},{"value":"L14","level":"D","label":"广告招牌制作架设人员，广告画绘制人员"}]}]},{"value":"卫生保健业","label":"卫生保健业","children":[{"value":"医院","label":"医院","children":[{"value":"M01","level":"1","label":"一般医务行政人员"},{"value":"M02","level":"1","label":"一般医师及护士"},{"value":"M03","level":"3","label":"精神病科医师、看护及护士"},{"value":"M04","level":"3","label":"兽医"},{"value":"M05","level":"2","label":"医院炊事"},{"value":"M06","level":"2","label":"杂工"},{"value":"M07","level":"2","label":"清洁工"}]},{"value":"保健人员","label":"保健人员","children":[{"value":"M08","level":"1","label":"病理检查员"},{"value":"M09","level":"1","label":"分析员"},{"value":"M10","level":"2","label":"放射线的技术人员"},{"value":"M11","level":"4","label":"放射线的维修人员"},{"value":"M12","level":"2","label":"助产士"},{"value":"M13","level":"2","label":"跌打损伤治疗人员"},{"value":"M14","level":"2","label":"监狱、看守所医生、护理人员"}]}]},{"value":"娱乐业","label":"娱乐业","children":[{"value":"电影业、电视业","label":"电影业、电视业","children":[{"value":"N01","level":"1","label":"制片人"},{"value":"N02","level":"1","label":"影片商"},{"value":"N03","level":"1","label":"编剧"},{"value":"N04","level":"2","label":"一般演员(导演)"},{"value":"N05","level":"D","label":"武打演员"},{"value":"N06","level":"D","label":"特技演员"},{"value":"N07","level":"1","label":"化妆师"},{"value":"N08","level":"2","label":"场记"},{"value":"N09","level":"2","label":"摄影工作人员"},{"value":"N10","level":"2","label":"灯光及音响效果工作人员"},{"value":"N11","level":"2","label":"冲片工作人员"},{"value":"N12","level":"2","label":"洗片工作人员"},{"value":"N13","level":"2","label":"电视记者"},{"value":"N14","level":"4","label":"机械工、电工"},{"value":"N15","level":"4","label":"布景搭设人员"},{"value":"N16","level":"1","label":"电影院售票员"},{"value":"N17","level":"2","label":"电影院放映人员"},{"value":"N18","level":"2","label":"电影院服务人员"},{"value":"N19","level":"D","label":"跑片员"}]},{"value":"高尔夫球场","label":"高尔夫球场","children":[{"value":"N20","level":"2","label":"教练"},{"value":"N21","level":"2","label":"球场保养工人"},{"value":"N22","level":"2","label":"维护工人"},{"value":"N23","level":"2","label":"球童"}]},{"value":"保龄球馆","label":"保龄球馆","children":[{"value":"N24","level":"1","label":"记分员"},{"value":"N25","level":"1","label":"柜台人员"},{"value":"N26","level":"4","label":"机械修护工人"},{"value":"N27","level":"2","label":"清洁工人"}]},{"value":"球场","label":"球场","children":[{"value":"N28","level":"2","label":"负责人"},{"value":"N29","level":"2","label":"记分员"}]},{"value":"游泳池","label":"游泳池","children":[{"value":"N30","level":"2","label":"负责人"},{"value":"N31","level":"2","label":"管理员"},{"value":"N32","level":"2","label":"教练"},{"value":"N33","level":"1","label":"售票员"},{"value":"N34","level":"4","label":"救生员"}]},{"value":"海水浴场","label":"海水浴场","children":[{"value":"N35","level":"1","label":"负责人"},{"value":"N36","level":"1","label":"管理员"},{"value":"N37","level":"1","label":"售票员"},{"value":"N38","level":"D","label":"救生员"}]},{"value":"游乐园","label":"游乐园","children":[{"value":"N39","level":"1","label":"负责人"},{"value":"N40","level":"1","label":"售票员"},{"value":"N41","level":"2","label":"电动游乐器具操作员"},{"value":"N42","level":"2","label":"一般清洁工"},{"value":"N43","level":"4","label":"兽栏清洁工"},{"value":"N44","level":"4","label":"水电机械工"},{"value":"N45","level":"D","label":"动物园驯兽师"},{"value":"N46","level":"D","label":"饲养人员"},{"value":"N47","level":"4","label":"兽医(动物园)"}]},{"value":"艺术及演艺人员","label":"艺术及演艺人员","children":[{"value":"N48","level":"1","label":"作曲人员"},{"value":"N49","level":"1","label":"编曲人员"},{"value":"N50","level":"1","label":"演奏人员"},{"value":"N51","level":"1","label":"绘画人员"},{"value":"N52","level":"3","label":"舞蹈演艺人员"},{"value":"N53","level":"2","label":"雕塑人员"},{"value":"N54","level":"2","label":"戏剧人员"},{"value":"N55","level":"4","label":"巡回演出戏剧团体人员"},{"value":"N56","level":"1","label":"作家"}]},{"value":"娱乐场所","label":"娱乐场所","children":[{"value":"N57","level":"3","label":"KTV、MTV，舞厅，酒吧工作人员(不包括陪唱，陪舞，陪酒等三陪人员)"},{"value":"N58","level":"4","label":"保安人员"},{"value":"N59","level":"2","label":"调酒师"},{"value":"N60","level":"3","label":"乐队人员"},{"value":"N61","level":"3","label":"歌唱人员"},{"value":"N62","level":"3","label":"调音师(DJ)"},{"value":"N63","level":"2","label":"收银员"},{"value":"N64","level":"3","label":"负责人"},{"value":"N65","level":"2","label":"职业按摩师(提供经营许可证）"},{"value":"N66","level":"1","label":"配音演员"},{"value":"N67","level":"S","label":"非高处表演的杂技演员"},{"value":"N68","level":"D","label":"高处表演的杂技演员"},{"value":"N69","level":"3","label":"电子游戏室及网吧负责人"},{"value":"N70","level":"3","label":"迪斯科接待人员"},{"value":"N71","level":"3","label":"桌球房接待人员"},{"value":"N72","level":"2","label":"寄存处人员"},{"value":"N73","level":"3","label":"舞蹈演艺员(有演出证）"},{"value":"N74","level":"3","label":"咖啡室， 茶室，酒店工作人员"},{"value":"N75","level":"D","label":"吧女、酒女、舞女、咖啡女郎、非职业按摩师"}]}]},{"value":"文教机关","label":"文教机关","children":[{"value":"教育机构","label":"教育机构","children":[{"value":"O01","level":"1","label":"教师"},{"value":"O02","level":"2","label":"学生"},{"value":"O03","level":"2","label":"校工"},{"value":"O04","level":"2","label":"军训教官"},{"value":"O05","level":"2","label":"体育教师"}]},{"value":"其他","label":"其他","children":[{"value":"O06","level":"1","label":"负责人(出版商、书店、文具店)"},{"value":"O07","level":"1","label":"店员"},{"value":"O08","level":"2","label":"外务员"},{"value":"O09","level":"3","label":"送货员"},{"value":"O10","level":"1","label":"图书馆工作人员"},{"value":"O11","level":"1","label":"博物馆工作人员"},{"value":"O12","level":"3","label":"汽车驾驶训练班教练"},{"value":"O13","level":"3","label":"各项运动教练及运动员,有氧运动教师"}]}]},{"value":"宗教团体","label":"宗教团体","children":[{"value":"宗教人士","label":"宗教人士","children":[{"value":"P01","level":"1","label":"寺庙及教堂管理人员"},{"value":"P02","level":"1","label":"宗教团体工作人员"},{"value":"P03","level":"1","label":"僧尼、道士及传教人员"}]}]},{"value":"公共事业","label":"公共事业","children":[{"value":"邮政、邮递业、司法","label":"邮政、邮递业、司法","children":[{"value":"Q01","level":"1","label":"内勤人员"},{"value":"Q02","level":"3","label":"外勤邮务人员"},{"value":"Q03","level":"3","label":"包裹搬运人员"},{"value":"Q04","level":"3","label":"商业犯罪调查处理人员"},{"value":"Q05","level":"1","label":"法官、律师、书记员、翻译员"},{"value":"Q06","level":"D","label":"快递人员(摩托车)"},{"value":"Q07","level":"4","label":"快递人员(汽车、助动车、自行车)"}]},{"value":"电讯及电力 ","label":"电讯及电力 ","children":[{"value":"Q08","level":"D","label":"编接电缆工人、拉线工人、维修工人"},{"value":"Q09","level":"D","label":"变压器操作工人和隧道工人"},{"value":"Q10","level":"1","label":"负责顾问及设计工作的电机工程师"},{"value":"Q11","level":"3","label":"负责监督及视察工作的电机工程师"},{"value":"Q12","level":"1","label":"负责行政工作人员"},{"value":"Q13","level":"4","label":"负责监督及视察的工作人员"},{"value":"Q14","level":"4","label":"住宅拉线工人"},{"value":"Q15","level":"4","label":"办公室大厦及工厂的维修工人"},{"value":"Q16","level":"3","label":"安装电表、修理电表"},{"value":"Q17","level":"2","label":"发电厂的总工程师"},{"value":"Q18","level":"2","label":"抄表工人"},{"value":"Q19","level":"3","label":"电力输送员"},{"value":"Q20","level":"4","label":"技工、中汇站测试员、装配工人、总机拉线工人及维修工人"},{"value":"Q21","level":"4","label":"操作员及变压器操作员"},{"value":"Q22","level":"1","label":"发电厂监督"},{"value":"Q23","level":"4","label":"发电站工程师、涡轮机操作员或轮机房工作人员"},{"value":"Q24","level":"4","label":"发电站司炉工人"},{"value":"Q25","level":"3","label":"督导"},{"value":"Q26","level":"D","label":"建造电缆、架空电线的操作工及安装或维修塔架工人"},{"value":"Q27","level":"4","label":"地底或电板拉设工人、督察、巡视员"}]},{"value":"自来水(水利)","label":"自来水(水利)","children":[{"value":"Q28","level":"2","label":"工程师"},{"value":"Q29","level":"3","label":"水坝、水库管理人员"},{"value":"Q30","level":"4","label":"水利工程设施人员"},{"value":"Q31","level":"3","label":"自来水管装修人员"},{"value":"Q32","level":"2","label":"抄表员、收费员"},{"value":"Q33","level":"3","label":"自来水厂水质分析员(实地)"}]},{"value":"煤气","label":"煤气","children":[{"value":"Q34","level":"2","label":"工程师"},{"value":"Q35","level":"3","label":"管线装修工"},{"value":"Q36","level":"2","label":"抄表员、收费员"},{"value":"Q37","level":"2","label":"检查员"},{"value":"Q38","level":"4","label":"煤气器具制造工及煤气分装工"}]}]},{"value":"一般商业","label":"一般商业","children":[{"value":"买卖","label":"买卖","children":[{"value":"R01","level":"3","label":"个体经营者"},{"value":"R02","level":"2","label":"一般营业员"},{"value":"R03","level":"3","label":"果菜营业员"},{"value":"R04","level":"4","label":"鱼肉营业员"},{"value":"R05","level":"3","label":"矿物油营业员"},{"value":"R06","level":"4","label":"鱼肉贩"},{"value":"R07","level":"3","label":"化学原料营业员"},{"value":"R08","level":"3","label":"送货员(一般商业买卖)"},{"value":"R09","level":"4","label":"送货员（钢材、石材、建材、五金或电器）"},{"value":"R10","level":"3","label":"装设工"},{"value":"R11","level":"2","label":"液化气零售商"},{"value":"R12","level":"4","label":"煤气分装工"},{"value":"R13","level":"4","label":"旧货收购人员"},{"value":"R14","level":"1","label":"税务人员"},{"value":"R15","level":"3","label":"搬运工（一般）"},{"value":"R16","level":"4","label":"搬运工（净水）"}]}]},{"value":"服务业","label":"服务业","children":[{"value":"银行、保险、信托、租赁","label":"银行、保险、信托、租赁","children":[{"value":"S01","level":"1","label":"一般内勤人员"},{"value":"S02","level":"2","label":"外务员"},{"value":"S03","level":"2","label":"收费员"},{"value":"S04","level":"2","label":"调查员"},{"value":"S05","level":"2","label":"征信人员"},{"value":"S06","level":"4","label":"现金运送员、司机"}]},{"value":"自由业","label":"自由业","children":[{"value":"S07","level":"1","label":"律师"},{"value":"S08","level":"1","label":"会计师"},{"value":"S09","level":"1","label":"代书(内勤)"},{"value":"S10","level":"1","label":"经纪人(内勤)"},{"value":"S11","level":"2","label":"外勤员"}]},{"value":"其他","label":"其他","children":[{"value":"S12","level":"2","label":"公证行外务员"},{"value":"S13","level":"2","label":"报关行外务员"},{"value":"S14","level":"2","label":"理发师"},{"value":"S15","level":"2","label":"美容师"},{"value":"S16","level":"2","label":"钟表匠"},{"value":"S17","level":"2","label":"鞋匠、雨伞匠"},{"value":"S18","level":"2","label":"洗衣店工人"},{"value":"S19","level":"2","label":"勘舆师"},{"value":"S20","level":"3","label":"警卫人员(内勤)"},{"value":"S21","level":"4","label":"警卫人员(负有巡逻押运任务者)"},{"value":"S22","level":"2","label":"大楼管理员"},{"value":"S23","level":"1","label":"摄影师"},{"value":"S24","level":"3","label":"道路清洁工"},{"value":"S25","level":"4","label":"下水道路清洁工"},{"value":"S26","level":"2","label":"清洁、打蜡工人"},{"value":"S27","level":"D","label":"高楼外部清洁工"},{"value":"S28","level":"2","label":"车辆保管人员"},{"value":"S29","level":"2","label":"加油站人员"},{"value":"S30","level":"2","label":"地磅人员"},{"value":"S31","level":"D","label":"烟囱清洁工"},{"value":"S32","level":"1","label":"浴室负责人"},{"value":"S33","level":"2","label":"浴室柜台人员"},{"value":"S34","level":"2","label":"浴室工作人员"},{"value":"S35","level":"3","label":"勤杂工"},{"value":"S36","level":"2","label":"门卫"}]},{"value":"汽车美容业、装潢业","label":"汽车美容业、装潢业","children":[{"value":"S37","level":"4","label":"一般工人(手工)"},{"value":"S38","level":"3","label":"一般工人(机械)"},{"value":"S39","level":"1","label":"设计员"}]},{"value":"殡丧业、殡葬馆","label":"殡丧业、殡葬馆","children":[{"value":"S40","level":"3","label":"殡葬车的驾驶员"},{"value":"S41","level":"4","label":"搬运工"},{"value":"S42","level":"3","label":"火化工人"},{"value":"S43","level":"2","label":"美容师、化妆师"}]}]},{"value":"家管","label":"家管","children":[{"value":"家庭管理","label":"家庭管理","children":[{"value":"T01","level":"2","label":"家庭主妇"},{"value":"T02","level":"2","label":"保姆及钟点工"},{"value":"T03","level":"2","label":"儿童"},{"value":"T04","level":"2","label":"退休人员"}]}]},{"value":"治安","label":"治安","children":[{"value":"治安人员","label":"治安人员","children":[{"value":"U01","level":"1","label":"警卫行政及内勤人员"},{"value":"U02","level":"3","label":"警察(负有巡逻任务者)"},{"value":"U03","level":"3","label":"监狱看守所管理人员"},{"value":"U04","level":"4","label":"交通警察"},{"value":"U05","level":"D","label":"刑警"},{"value":"U06","level":"D","label":"消防队队员"},{"value":"U07","level":"D","label":"防暴警察及负有防暴任务的警员"},{"value":"U08","level":"D","label":"警校学生"},{"value":"U09","level":"4","label":"调查局外勤人员"}]}]},{"value":"军人 ","label":"军人 ","children":[{"value":"现役军人","label":"现役军人","children":[{"value":"V01","level":"1","label":"通勤的行政及内勤人员(国防部、三军总部、军校教官等)"},{"value":"V02","level":"1","label":"后勤补给及通讯地勤人员"},{"value":"V03","level":"1","label":"军医院官兵"},{"value":"V04","level":"1","label":"军事研究单位纸上设计人员"},{"value":"V05","level":"3","label":"一般地面部队人员(含陆军野战、机械修护、土木工程、飞弹、战车及空军炮、飞机修护等)"},{"value":"V06","level":"D","label":"军事单位武器，弹药研究及管理人员"},{"value":"V07","level":"D","label":"空军飞行官兵、空军海洋巡弋舰艇及潜艇官兵"},{"value":"V08","level":"D","label":"前线军人"},{"value":"V09","level":"D","label":"军校学生及入伍受训新兵、特种部队(海军陆战队、伞兵、水兵)"},{"value":"V10","level":"D","label":"爆破兵、潜水员、化学兵、情报单位负有特殊任务者等"}]}]},{"value":"资讯业 ","label":"资讯业 ","children":[{"value":"资讯业 ","label":"资讯业 ","children":[{"value":"W01","level":"2","label":"维护工程师"},{"value":"W02","level":"1","label":"系统工程师"},{"value":"W03","level":"1","label":"销售工程师"}]}]},{"value":"职业运动员 ","label":"职业运动员 ","children":[{"value":"高尔夫球","label":"高尔夫球","children":[{"value":"Y01","level":"2","label":"教练"},{"value":"Y02","level":"2","label":"高尔夫球球员"},{"value":"Y03","level":"2","label":"球童"}]},{"value":"保龄球","label":"保龄球","children":[{"value":"Y04","level":"2","label":"教练"},{"value":"Y05","level":"2","label":"保龄球球员"}]},{"value":"桌球","label":"桌球","children":[{"value":"Y06","level":"2","label":"教练"},{"value":"Y07","level":"2","label":"桌球球员"}]},{"value":"羽毛球","label":"羽毛球","children":[{"value":"Y08","level":"2","label":"教练"},{"value":"Y09","level":"3","label":"羽毛球球员"}]},{"value":"游泳 ","label":"游泳 ","children":[{"value":"Y10","level":"2","label":"教练"},{"value":"Y11","level":"2","label":"游泳人员"}]},{"value":"射箭","label":"射箭","children":[{"value":"Y12","level":"2","label":"教练"},{"value":"Y13","level":"2","label":"射箭人员"}]},{"value":"网球","label":"网球","children":[{"value":"Y14","level":"2","label":"教练"},{"value":"Y15","level":"3","label":"网球球员"}]},{"value":"垒球","label":"垒球","children":[{"value":"Y16","level":"2","label":"教练"},{"value":"Y17","level":"3","label":"垒球球员"}]},{"value":"溜冰","label":"溜冰","children":[{"value":"Y18","level":"2","label":"教练"},{"value":"Y19","level":"3","label":"溜冰人员"}]},{"value":"射击","label":"射击","children":[{"value":"Y20","level":"2","label":"教练"},{"value":"Y21","level":"2","label":"射击人员"}]},{"value":"民俗体育活动","label":"民俗体育活动","children":[{"value":"Y22","level":"2","label":"教练"},{"value":"Y23","level":"2","label":"民俗体育活动人员"}]},{"value":"举重 ","label":"举重 ","children":[{"value":"Y24","level":"2","label":"教练"},{"value":"Y25","level":"4","label":"举重人员"}]},{"value":"篮球","label":"篮球","children":[{"value":"Y26","level":"2","label":"教练"},{"value":"Y27","level":"3","label":"篮球球员"}]},{"value":"排球","label":"排球","children":[{"value":"Y28","level":"2","label":"教练"},{"value":"Y29","level":"3","label":"排球球员"}]},{"value":"棒球","label":"棒球","children":[{"value":"Y30","level":"2","label":"教练"},{"value":"Y31","level":"3","label":"棒球球员"}]},{"value":"田径 ","label":"田径 ","children":[{"value":"Y32","level":"2","label":"教练"},{"value":"Y33","level":"3","label":"参赛人员"}]},{"value":"体操","label":"体操","children":[{"value":"Y34","level":"2","label":"教练"},{"value":"Y35","level":"3","label":"体操人员"}]},{"value":"滑水","label":"滑水","children":[{"value":"Y36","level":"D","label":"教练"},{"value":"Y37","level":"D","label":"滑水人员"}]},{"value":"帆船","label":"帆船","children":[{"value":"Y38","level":"3","label":"教练"},{"value":"Y39","level":"4","label":"驾乘人员"}]},{"value":" 划船","label":" 划船","children":[{"value":"Y40","level":"3","label":"教练"},{"value":"Y41","level":"4","label":"驾乘人员"}]},{"value":"泛舟","label":"泛舟","children":[{"value":"Y42","level":"4","label":"驾乘人员"}]},{"value":"巧固球","label":"巧固球","children":[{"value":"Y43","level":"2","label":"教练"},{"value":"Y44","level":"4","label":"巧固球球员"}]},{"value":"手球","label":"手球","children":[{"value":"Y45","level":"2","label":"教练"},{"value":"Y46","level":"4","label":"手球球员"}]},{"value":"风浪板","label":"风浪板","children":[{"value":"Y47","level":"4","label":"教练"},{"value":"Y48","level":"D","label":"驾乘人员"}]},{"value":"水上摩托车","label":"水上摩托车","children":[{"value":"Y49","level":"4","label":"教练"},{"value":"Y50","level":"D","label":"驾乘人员"}]},{"value":"足球","label":"足球","children":[{"value":"Y51","level":"4","label":"教练"},{"value":"Y52","level":"4","label":"足球球员"}]},{"value":"曲棍球","label":"曲棍球","children":[{"value":"Y53","level":"3","label":"教练"},{"value":"Y54","level":"D","label":"曲棍球球员"}]},{"value":"冰上曲棍球","label":"冰上曲棍球","children":[{"value":"Y55","level":"3","label":"教练"},{"value":"Y56","level":"D","label":"冰上曲棍球球员"}]},{"value":"橄榄球","label":"橄榄球","children":[{"value":"Y57","level":"3","label":"教练"},{"value":"Y58","level":"D","label":"橄榄球球员"}]},{"value":"乒乓球","label":"乒乓球","children":[{"value":"Y59","level":"2","label":"教练"},{"value":"Y60","level":"3","label":"乒乓球球员"}]},{"value":"击剑","label":"击剑","children":[{"value":"Y61","level":"D","label":"击剑运动员"},{"value":"Y62","level":"D","label":"教练员"}]},{"value":"水球","label":"水球","children":[{"value":"Y63","level":"D","label":"教练"},{"value":"Y64","level":"D","label":"运动员"}]},{"value":"马术","label":"马术","children":[{"value":"Y65","level":"D","label":"教练"},{"value":"Y66","level":"D","label":"运动员"}]},{"value":"摔跤","label":"摔跤","children":[{"value":"Y67","level":"D","label":"教练"},{"value":"Y68","level":"D","label":"运动员"}]},{"value":"卡丁车","label":"卡丁车","children":[{"value":"Y69","level":"4","label":"教练"},{"value":"Y70","level":"D","label":"运动员"}]}]},{"value":"特殊行业","label":"特殊行业","children":[{"value":"特殊行业","label":"特殊行业","children":[{"value":"Z01","level":"2","label":"自由投资者(需填个人投资问卷）"},{"value":"Z02","level":"2","label":"待业人员"},{"value":"Z03","level":"S","label":"临时工、无固定职业"}]}]}];
	var $li1='';
	var $li2='';
	var $li3='';
	var city;
	var area;
	$.each(concat,function (i,val) {
	    $li1+="<li obj='"+i+"' value='"+val.value+"'>"+val.label+"</li>";
	});
	$("#c1").append($($li1));
	$("#c1").show();
	$("#c1").on("tap","li",function(){
		var i=$(this).attr("obj");
		city = concat[i].children;
		//console.log(city)
	    //取得值
	    //alert(provinceList[i].name,city[0].name);
	    var text=$(this).text();
	    $("#province").val(text);
	    //$("#c1").hide();
	    $("#c2,#c3").empty();
	    $li2="";
	    //添加节点
	    $.each(city,function (i,val) {
	        $li2+="<li obj='"+i+"' value='"+val.value+"'>"+val.label+"</li>";
	    });
	    $("#c2").append($($li2));
	    $("#c2").show();
	    $("#province").trigger("change");
	});

	$("#c2").on("tap","li",function(){
		var i=$(this).attr("obj");
	    area=city[i].children;
				//alert(city[i].name);
	    var text=$(this).text();
	    $("#city").val(text);

	    //$("#c2").hide();
	    $("#c3").empty();
	    $li3="";
	    $.each(area,function(i,val){
	        $li3+="<li jobtype='"+val.level+"' value='"+val.value+"'>"+val.label+"</li>"
	    });
	    $("#c3").append($($li3));
	    $("#c3").show();
	    $("#city").trigger("change");
	});
	//初始化显示
	var occ = "";
	var length = concat.length;
	for(var i=0;i<length;i++){
		occ += '<li class="mui-table-view-cell">'+concat[i].label+'</li>';

		//occ += '<li class="mui-table-view-cell" jobtype="'+_OCC[i].level+'" value="'+_OCC[i].code+'">'+_OCC[i].name+'</li>';
	}
	$("#career").html(occ);
	//快速搜素
	$("#search").click(function(){
		var serocc = "";
		var searchText = $("input[name='search']").val();
		/* for(var i=0;i<_OCC.length;i++){
			if(_OCC[i].name.indexOf(searchText) != -1){
				console.log(i+","+$(this).val())
				serocc += '<li class="mui-table-view-cell" jobtype="'+_OCC[i].level+'" value="'+_OCC[i].code+'">'+_OCC[i].name+'</li>';
			}
		} */
		for(var i=0;i<concat.length;i++){
			for(var j=0;j<concat[i].children.length;j++){
				for(var k=0;k<concat[i].children[j].children.length;k++){
					if(concat[i].children[j].children[k].label.indexOf(searchText) != -1){
						//console.log(concat[i].label+"---"+concat[i].children[j].label+"---"+concat[i].children[j].children[k].label)
						$("#career").show();
						$("#c1,#c2,#c3").hide();
						serocc += '<p class="mui-table-view-cell" jobtype="'+concat[i].children[j].children[k].level+'" value="'+concat[i].children[j].children[k].value+'" cont="'+concat[i].children[j].children[k].label+'" >'+concat[i].label+"->"+concat[i].children[j].label+"->"+concat[i].children[j].children[k].label+'</p>';
					}
				}
			}
		}
		if(!serocc){
			$("#career").show();
			$("#c1,#c2,#c3").hide();
			$("#career").html("抱歉，未搜到相关职业！");
			return;
		}
		$("#career").html(serocc);
	});

	//准客户列表
	var cushtml="";
	try{
		var cuslist;
		$.ajax({
			type: 'get',
			url: "/agentwap/customer/customerlistjys.do",
			dataType: "json",
			async: false,
			data: {
				agentCode: getUrlParam('agentCode')
			},
			success: function (data) {
				cuslist = data;
			}
		});
		//console.log(cuslist,99999999)
		var length = cuslist.preCustomerList.length;

		var listjson=cuslist.preCustomerList;
		for(var i=0;i<length;i++){
			cushtml+='<li class="mui-table-view-cell"  value="'+listjson[i].id+'">';
			cushtml+='<table style="width: 100%;text-align: center;">';
			cushtml+='<tr>';
			cushtml+='<td style="width:33.33%">'+listjson[i].name+'</td>';
			cushtml+='<td style="width:33.33%">'+listjson[i].mobile+'</td>';
			cushtml+='<td style="width:33.33%">'+listjson[i].credentialTypeName+'</td>';
			cushtml+='</tr>';
			cushtml+='</table>';
			cushtml+='</li>';
		}
		cusJson=listjson;
		 $("#cusinfo").html(cushtml);
	}catch(e){
		$("#cusinfo").html("暂无客户信息");
	}
	//快速搜素
	$("#searchcus").click(function(){
		var cuslist;
		$.ajax({
			type: 'get',
			url: "/agentwap/customer/customerlistjys.do",
			dataType: "json",
			async: false,
			data: {
				agentCode: getUrlParam('agentCode')
			},
			success: function (data) {
				cuslist = data;
			}
		});
		try{
			var length = cuslist.preCustomerList.length;
			var cushtml="";
			var listjson=cuslist.preCustomerList;
			var searchText = $("input[name='searchcus']").val();
			for(var i=0;i<length;i++){
				if(listjson[i].name.indexOf(searchText) != -1){
					//console.log(i+","+$(this).val())
					cushtml+='<li class="mui-table-view-cell"  value="'+listjson[i].id+'">';
					cushtml+='<table style="width: 100%;text-align: center;">';
					cushtml+='<tr>';
					cushtml+='<td style="width:33.33%">'+listjson[i].name+'</td>';
					cushtml+='<td style="width:33.33%">'+listjson[i].mobile+'</td>';
					cushtml+='<td style="width:33.33%">'+listjson[i].credentialTypeName+'</td>';
					cushtml+='</tr>';
					cushtml+='</table>';
					cushtml+='</li>';
				}
			}
		}catch(e){

		}

		if(!cushtml){
			$("#cusinfo").html("抱歉，未搜到客户信息！");
			return;
		}
		$("#cusinfo").html(cushtml);

	});


})(jQuery)

function toNext(){
	var channel = localStorage.getItem("channel");
	if (channel == 1 || channel == 2) {
		rrwebsdk.leaveReport(function (state) {
			if (state) {
				rrwebsdk.restoreReport(); // 开始录制
				submissions();
			} else {
				mui.alert(rrwebsdkErrors); // 强制上报失败，自行处理异常
				rrwebsdk.restoreReport(); // 开始录制
			}
		});
	}else{
		submissions();
	}

	function submissions(){
		var removeOrderNo = getUrlParam("orderNo");
		storage.remove(removeOrderNo+"_watFlag");
		if(checkAll()){
			var tbrgx;
			var tbrage;
			var bbrgx;
			var bbrage;
			var syrgx;
			var syrage;
			var bage;
			var day;
			var tday;
			var bday;
			var personID =agentinfo.agentCode;
			var personCode =personID.substring(0,2);

	/*  if($("#tbrinfo").find("div[name='position']").html().indexOf(agentinfo.agentComName)==-1){
		mui.alert("投保人联系地址的省份需与营销员所在区域省份不一致!");
		return;
	} */
	if (typeof($("#tbrinfo").find("input[name='taxpayerCode']").val()) != "undefined"&&typeof($("#tbrinfo").find("input[name='socialCode']").val()) != "undefined"){
		if($("#tbrinfo").find("input[name='taxpayerCode']").val()!=""&&$("#tbrinfo").find("input[name='socialCode']").val()!=""){
			mui.alert("纳税人识别号与社会信用代码不能同时录入!");
			return;
		}else if($("#tbrinfo").find("input[name='taxpayerCode']").val()==""&&$("#tbrinfo").find("input[name='socialCode']").val()==""){
			mui.alert("纳税人识别号与社会信用代码不能同时为空!");
			return;
		}else{
			if($("#tbrinfo").find("input[name='socialCode']").val()!=""&&$("#tbrinfo").find("input[name='socialCode']").val().length!=18){
				mui.alert("社会信用代码长度需为18位!");
				return;
			}
		}
		/* if($("#tbrinfo").find("input[name='taxpayerCode']").val()!=""){
			if($("#tbrinfo").find("input[name='organizationCode']").val()==""){
				mui.alert("请填写组织机构代码!");
				return;
			}

		} */
	}
	//直接选择已承保客户信息,职业及年收入校验
	changeSalaryRemark();
	var salaryRemark1 =	document.getElementById('trbsalaryRemark1');
	//先判断DOM中是否有说明记录的元素
	if(salaryRemark1){
		//提交前判断下职业及年收入说明是否已填
		if(salaryVerify =='0'){
			var trbsalaryRemark1=$("#trbsalaryRemark1").val().trim();
			if(!trbsalaryRemark1){
				mui.alert("请填写投保人的具体职位说明。");
				return false;
			}
			var trbsalaryRemark2=$("#trbsalaryRemark2").val().trim();
			if(!trbsalaryRemark2){
				mui.alert("请填写投保人的年收入构成说明。");
				return false;
			}
		}
	}

	//投保人--证件类型--外国人永久居住证校验判断
	var checkflag = true;
	$("div[name='certificateType']").each(function(){
		var partyType=$(this).parent().parent().attr("id");
		var cardType = $(this).parent().parent().find("div[name='certificateType']").attr("value");
		var cardNum = $(this).parent().parent().find("input[name='certificateNum']").val();
		var birthDate = $(this).parent().parent().find("div[name='birthDate']").html();
		console.log("partyType======"+partyType);
		console.log("cardType======"+cardType);
		console.log("cardNum======"+cardNum);
		console.log("birthDate======"+birthDate);
		var type="";
		if(partyType=='tbrinfo') {
			type = "投保人";
		}
		if(partyType=='mbbrinfo') {
			type = "被保人"
		}
		if(partyType=='ssyinfo') {
			type = "受益人"
		}

		if (10 == cardType) {
			if ("请选择日期" != birthDate && 0 != cardNum.length) {
				var birthday = birthDate.replaceAll("-", "");
				if (!checkCardType10(type, cardNum, birthday)) {
					checkflag = false;
				}
			}
		}
	});
	if(!checkflag){
		return false;
	}
	var falg=true;
	$(".relationship").each(function(){
		var partyType=$(this).parent().parent().attr("id");
		if(partyType=='tbrinfo'){
			tbrgx=$(this).attr("value");
			tbrage=ageCf($(this).parent().parent().find("div[name='birthDate']").html(),new Date());
			tday=getDays($(this).parent().parent().find("div[name='birthDate']").html(),new Date());
		}
		if(partyType=='mbbrinfo'){
			bbrgx=$(this).attr("value");
			bbrage=ageCf($(this).parent().parent().find("div[name='birthDate']").html(),new Date());
			bday=getDays($(this).parent().parent().find("div[name='birthDate']").html(),new Date());

		}
		if(partyType=='ssyinfo'){
			syrgx=$(this).attr("value");
			syrage=ageCf($(this).parent().parent().find("div[name='birthDate']").html(),new Date());

		}
	})

	if(tbrgx=="00"){
		bage=tbrage;
		day=tday;
	}else{
		bage=bbrage;
		day=bday;
	}
	var productCod=getUrlParam("productCode");
	if(productCod=="100020"||productCod=="100040"||productCod=="100060"||productCod=="100170"||productCod=="100500"||productCod == "100700"||productCod=="100150"||productCod=="101000"
			||productCod=="101400"||productCod=="100100"||productCod=="100140"||productCod=="100120"||productCod=="101200"||productCod=="100130"||productCod=="100280"){
		if(bage>65){
			mui.alert('被保人年龄已经超过所投产品的最大投保年龄');
			hideLoad();
			falg=false;
			return false;
		}
	}else if(productCod=="100070" || productCod=="100800" || productCod=="101300" || productCod=="101900"){
		if(bage>75){
			mui.alert('被保人年龄已经超过所投产品的最大投保年龄');
			hideLoad();
			falg=false;
			return false;
		}
	}else if(productCod=="100080" || productCod=="100160"){
		if(bage+5>70){
			mui.alert('被保人年龄已经超过所投产品的最大投保年龄');
			hideLoad();
			falg=false;
			return false;
		}
	}else if(productCod=="100110"){
		if(bage>55){
			mui.alert('被保人年龄已经超过所投产品的最大投保年龄');
			hideLoad();
			falg=false;
			return false;
		}
	}else if(productCod=="100180"||productCod =="100290"||productCod =="100310"||productCod=="100200"||productCod=="100400"||productCod=="100300"){
		if(bage>60){
			mui.alert('被保人年龄已经超过所投产品的最大投保年龄');
			hideLoad();
			falg=false;
			return false;
		}
	}else if(productCod=="100190"){
		if(bage>55||bage<18){
			mui.alert('被保人年龄已经不符合产品投保年龄(18周岁至55周岁)');
			hideLoad();
			falg=false;
			return false;
		}
	}else if(productCod=="100210"){
		if($("#mbbrinfo").find("div[name='gender']").hasClass("mui-active")==true){
			if(bage>65){
				mui.alert('被保人年龄已经超过所投产品的最大投保年龄');
				hideLoad();
				falg=false;
				return false;
			}
		}else{
			if(bage>60){
				mui.alert('被保人年龄已经超过所投产品的最大投保年龄');
				hideLoad();
				falg=false;
				return false;
			}
		}
    }else if(productCod=="100900" || productCod=="101100" || productCod=="101500" || productCod=="101700"){
		if(bage>70){
			mui.alert('被保人年龄已经超过所投产品的最大投保年龄');
			hideLoad();
			falg=false;
			return false;
		}
	}else if(productCod=="100038" || productCod === "100044"){
		if(bage>64){
			mui.alert('被保人年龄已经超过所投产品的最大投保年龄');
			hideLoad();
			falg=false;
			return false;
		}
	}else if(productCod=="102300"){
		if(bage>75||bage<18){
			mui.alert('被保人年龄不符合产品投保年龄(18周岁至75周岁)');
			hideLoad();
			falg=false;
			return false;
		}
	}
	if(day<30){
		mui.alert('被保人年龄未满30天,不允许投保');
		hideLoad();
		falg=false;
		return false;
	}
	if(falg==false){
		return false;
	}
	if($('#trcardtype').attr('value') ==="15"){
		if($('#tbrcardnum').val().length>10){
			mui.alert("投保人证件号码有误")
			return false;
		}
	}
	if($('#brcardtype').attr('value') ==="15"){
		if($('#bbrcardnum').val().length>10){
			mui.alert("被保人证件号码有误")
			return false;
		}
	}
	if($('#sscardtype').attr('value') ==="15"){
		if($('#ssrcardnum').val().length>10){
			mui.alert("受益人证件号码有误")
			return false;
		}
	}
	if(agentinfo.channel == "1" || agentinfo.channel == "2"){
		var tbrCareerCode = $("#tbrinfo").find("div[name='career']").attr('value');
		var bbrCareerCode = $("#mbbrinfo").find("div[name='career']").attr('value');
		let statuses = {'T01':'家庭主妇','T02':'保姆及钟点工','T03':'儿童','T04':'退休人员','Z01':'自由投资者','Z02':'待业人员','Z03':'临时工、无固定职业'};
		var result = statuses[tbrCareerCode];
		if(result == null){
			if($("#tbrinfo").find("input[name='workUnits']").val()==''){
				mui.alert('请填写投保人单位/学校名称');
				hideLoad();
				return false;
		  	}
			if($("#tbrinfo").find("div[name='workAddr']").text()=='请选择省市' || $("#tbrinfo").find("div[name='workAddr']").text()=='请选择 请选择'){
				mui.alert('请选择投保人单位/学校地址');
				hideLoad();
				return false;
		  	}
            if($("#tbrinfo").find("input[name='dwposdetail']").val()==''){
                mui.alert('请填写投保人单位/学校详细地址');
                hideLoad();
                return false;
            }
		}


		 if($('#reInsured').text()!='本人'){
			var result = statuses[bbrCareerCode];
			if(result == null){
				if($("#mbbrinfo").find("input[name='workUnits']").val()==''){
					mui.alert('请填写被保人单位/学校名称');
					hideLoad();
					return false;
			  	}
				if($("#mbbrinfo").find("div[name='workAddr']").html()=='请选择省市' || $("#mbbrinfo").find("div[name='workAddr']").html()=='请选择 请选择'){
					mui.alert('请选择被保人单位/学校地址');
					hideLoad();
					return false;
		  		}
                if($("#mbbrinfo").find("input[name='dwposdetail']").val()==''){
                    mui.alert('请填写被保人单位/学校详细地址');
                    hideLoad();
                    return false;
                }
			}
		 }
	}else{
		if($("#tbrinfo").find("div[name='career']").attr('value')!='T03' && $("#tbrinfo").find("div[name='career']").attr('value')!='T04'&& $("#tbrinfo").find("div[name='career']").attr('value')!='T01'  ){

			if($("#tbrinfo").find("input[name='workUnits']").val()==''){
				mui.alert('请填写投保人单位/学校名称');
				hideLoad();
				return false;
		  	}
			if($("#tbrinfo").find("div[name='workAddr']").text()=='请选择省市' || $("#tbrinfo").find("div[name='workAddr']").text()=='请选择 请选择'){
				mui.alert('请选择投保人单位/学校地址');
				hideLoad();
				return false;
		  	}
		}


		 if($('#reInsured').text()!='本人'){
			if($("#mbbrinfo").find("div[name='career']").attr('value')!='T03' && $("#mbbrinfo").find("div[name='career']").attr("div[name='career']")!='T04' && $("#mbbrinfo").find("div[name='career']").attr('value')!='T01'){
				if($("#mbbrinfo").find("input[name='workUnits']").val()==''){
					mui.alert('请填写被保人单位/学校名称');
					hideLoad();
					return false;
			  	}
				if($("#mbbrinfo").find("div[name='workAddr']").html()=='请选择省市' || $("#mbbrinfo").find("div[name='workAddr']").html()=='请选择 请选择'){
					mui.alert('请选择被保人单位/学校地址');
					hideLoad();
					return false;
		  		}
			}
		 }
	}
		var tbrloc = $("div[id='tbrloc']").attr("value");
		var workAddr = $("div[id='workAddr']").attr("value");
		var bbrloc = $("div[id='bbrloc']").attr("value");
		var workUnits = $("div[id='workUnits']").attr("value");
		var syrloc = $("div[id='syrloc']").attr("value");
		var syrworkAddr = $("div[id='syrworkAddr']").attr("value");
		if(undefined != tbrloc && (tbrloc.includes("undefined") || tbrloc.length < 20)){
			mui.alert('投保人联系地址有误');
			hideLoad();
			return false;
		}
		if(undefined != workAddr && (workAddr.includes("undefined") || workAddr.length < 20)){
			mui.alert('投保人单位/学校地址有误');
			hideLoad();
			return false;
		}
		if(undefined != bbrloc && (bbrloc.includes("undefined") || bbrloc.length < 20)){
			mui.alert('被保人联系地址有误');
			hideLoad();
			return false;
		}
		if(undefined != workUnits && (workUnits.includes("undefined") || workUnits.length < 20)){
			mui.alert('被保人单位/学校地址有误');
			hideLoad();
			return false;
		}
		if(undefined != syrloc && (syrloc.includes("undefined") || syrloc.length < 20)){
			mui.alert('受益人联系地址有误');
			hideLoad();
			return false;
		}
		if(undefined != syrworkAddr && (syrworkAddr.includes("undefined") || syrworkAddr.length < 20)){
			mui.alert('受益人单位/学校地址有误');
			hideLoad();
			return false;
		}
		//获取投保人、被保人、受益人联系地址，判断因历史数据三级地市是否带有市辖区
		var tbraddr = $("#tbrloc").html();
		var tbraLength = tbraddr.length;
		var tbrName = tbraddr.substring(tbraLength-3,tbraLength);

		var bbraddr =$("#bbrloc").html();
		var bbrLength = bbraddr.length;
		var bbrtName = bbraddr.substring(bbrLength-3,bbrLength);

		var syraddr =$("#syrloc").html();
		var syrLength = syraddr.length;
		var syrName = syraddr.substring(syrLength-3,syrLength);
		if("市辖区" === tbrName || "市辖区" === bbrtName || "市辖区" === syrName){
			mui.alert('联系地址有误，请重新选择联系地址！');
			hideLoad();
			return false;
		}
	var weightReg = /^([1-9][0-9]*)+(.[0-9]{1,2})?$/;
	var heightReg = /^(0{1}|[1-9]\d{0,3})$/;
	var tbrheight = $('#tbrheight').val();
	var tbrwidth = $('#tbrwidth').val();
	var bbrheight = $('#bbrheight').val();
	var bbrwidth = $('#bbrwidth').val();
	if($('#reInsured').text()=='本人'){
		bbrheight = tbrheight;
		bbrwidth = tbrwidth;
	}

	if(null != tbrheight && tbrheight != undefined) {
		if(!heightReg.test(tbrheight)){
			mui.alert("投保人身高输入有误")
			return false;
		}else{
			$("#tbrheight").val("")
			$("#tbrheight").val(tbrheight)
		}
		if(tbrheight > 300){
			mui.alert("投保人身高输入有误，最大不能超过300厘米")
			$("#tbrheight").val("300")
			return false;
		}
		if(tbrheight == 0){
			mui.alert("投保人身高输入有误")
			return false;
		}
	}

	if(null != tbrwidth && tbrwidth != undefined) {
		if (tbrwidth > 200) {
			mui.alert("投保人体重输入有误，最大不能超过200公斤")
			$("#tbrwidth").val("200")
			return false;
		}
		if (tbrwidth == 0) {
			mui.alert("投保人体重输入有误")
			return false;
		}
		if (!weightReg.test(tbrwidth)) {
			mui.alert("投保人体重输入有误")
			return false;
		}
	}

	if(null != bbrheight && bbrheight != undefined) {
		if(!heightReg.test(bbrheight)){
			mui.alert("被保人身高输入有误")
			return false;
		}else{
			$("#bbrheight").val("")
			$("#bbrheight").val(bbrheight)
		}
		if(bbrheight > 300){
			mui.alert("被保人身高输入有误，最大不能超过300厘米")
			$("#bbrheight").val("300")
			return false;
		}
		if(bbrheight == 0){
			mui.alert("被保人身高输入有误")
			return false;
		}
	}

	if(null != bbrwidth && bbrwidth != undefined) {
		if(bbrwidth > 200){
			mui.alert("被保人体重输入有误，最大不能超过200公斤")
			$("#bbrwidth").val("200")
			return false;
		}
		if(bbrwidth == 0){
			mui.alert("被保人体重输入有误")
			return false;
		}
		if(!weightReg.test(bbrwidth)){
			mui.alert("被保人体重输入有误")
			return false;
		}
	}

	var tbrgxflag=false;
	var bbrgxflag=false;
	var syrgxflag=false;
	var addrflag=true;
	var checkallMsg=new Array();
	if(tbrgx=='00') {gx = "yes"}else{gx = "no"};   //投保人是否为是一人
 	if(tbrgx=='31'&&bbrgx=='32'){
		tbrgxflag=false;
		if(tbrage-bbrage<18){
			checkallMsg.push("投被保人为父母与子女关系，父母年龄未比子女大18岁");
		}else{
			tbrgxflag=true;
		}
	}else{
		tbrgxflag=true;
	}
	if(tbrgx=='32'&&bbrgx=='31'){
		bbrgxflag=false;
		if(bbrage-tbrage<18){
			checkallMsg.push("投被保人为子女与父母关系,父母年龄未比子女大18岁");
		}else{
			bbrgxflag=true;
		}
	}else{
		bbrgxflag=true;
	}
	if(syrgx=='31' && !$('#fadingsyr').hasClass('mui-active')){
		syrgxflag=false;
		if(syrage-bbrage<18){
			checkallMsg.push("受益人为被保险人父母,年龄差不足18岁");
		}else{
			syrgxflag=true;
		}
	}else if(syrgx=='32' && !$('#fadingsyr').hasClass('mui-active')){
			syrgxflag=false;
			if(bbrage-syrage<18){
				checkallMsg.push("受益人为被保险人子女,年龄差不足18岁");
			}else{
				syrgxflag=true;
			}
	}else{
		syrgxflag=true;
	}
	var pos = [{'key':'BJ','value':'北京'},{'key':'SH','value':'上海'},{'key':'ZJ','value':'浙江'},{'key':'JS','value':'江苏'},{'key':'SC','value':'四川'},{'key':'SD','value':'山东'},{'key':'HN','value':'河南'}];
	$(pos).each(function(i,e){
		if(personCode==e.key && $("#tbrinfo").find("div[name='position']").html().indexOf(e.value)==-1){
			addrflag = false;
			checkallMsg.push("投保人联系地址非合同签署地，将转人工核保");
		}
	});

	if($('#reInsured').text() !='本人'){
		$(pos).each(function(i,e){
			if(personCode==e.key && $("#mbbrinfo").find("div[name='position']").html().indexOf(e.value)==-1){
				addrflag = false;
				checkallMsg.push("被保人联系地址非合同签署地，将转人工核保");
			}
		});
	}
	if($("form[name='tbrinfo']").find("div[name='workAddr']").text().indexOf("请选择省市")!=-1 || $("form[name='tbrinfo']").find("div[name='workAddr']").text().indexOf("请选择")!=-1){

	}else{
		$(pos).each(function(i,e){
			if(personCode==e.key && $("#tbrinfo").find("div[name='workAddr']").html().indexOf(e.value)==-1){
				addrflag = false;
				checkallMsg.push("投保人单位地址非合同签署地，将转人工核保");
			}
		});

	}
	if($("form[name='mbbrinfo']").find("div[name='workAddr']").text().indexOf("请选择省市")!=-1 || $("form[name='mbbrinfo']").find("div[name='workAddr']").text().indexOf("请选择")!=-1){

	}else{
		if($('#reInsured').text() !='本人'){
			$(pos).each(function(i,e){
				if(personCode==e.key && $("#mbbrinfo").find("div[name='workAddr']").html().indexOf(e.value)==-1){
					addrflag = false;
					checkallMsg.push("被保人单位地址非合同签署地，将转人工核保");
				}
			});
		}
	}
	var tbrlocAddres = $('#tbrloc').text().replace(/\s*/g,"")+$('#trbposdetail').val().replace(/\s*/g,"");
	var tbrworkAddres = $('#workAddr').text().replace(/\s*/g,"")+$('#dwidposdetail').val().replace(/\s*/g,"");
	if(tbrlocAddres === tbrworkAddres){
		addrflag = false;
		checkallMsg.push("投保人联系地址和单位地址相同，将转人工核保");
	}
	if($('#reInsured').text() !='本人'){
		var bbrlocAddres = $('#bbrloc').text().replace(/\s*/g,"")+$('#bbrposdetail').val().replace(/\s*!/g,"");
		var bbrworkAddes = $("#mbbrinfo").find("div[name='workAddr']").html().replace(/\s*/g,"")+$("#mbbrinfo").find("input[id='dwidposdetail']").val().replace(/\s*!/g,"");
		if(bbrlocAddres === bbrworkAddes){
			addrflag = false;
			checkallMsg.push("被保人联系地址和单位地址相同，将转人工核保");
		}
	}
	if(!tbrgxflag||!bbrgxflag||!syrgxflag||!addrflag){
		var msgStr = "";
		 for(var msgi=0;msgi<checkallMsg.length;msgi++){
			msgStr+=(msgi+1)+"、"+checkallMsg[msgi]+"\n";
		 }
		 var btnArray = ['否', '是'];
		 mui.confirm(msgStr+"是否确定投保？", '提示', btnArray, function(e) {
            if (e.index == 1) {
            	hrefPage();
            } else {
               return;
            }
        })
	}else{
		hrefPage();
	}
	/* if(tbrgxflag==true&&bbrgxflag==true&&syrgxflag==true){
		hrefPage();
	} */
	function hrefPage(){
		showLoad();
		//整合页面录入信息
		var partyArray = new Array();
		//创建结果数组
		var resultArray=new Array();
		//序列化投保人录入项信息
		var tbrinfo = $("#tbrinfo").serializeParyForm("1");
		var tbrworkpostalCode = $("#tbrworkcode").val();
		tbrinfo.workpostalCode = tbrworkpostalCode;
		storage.set("tbrinfo",JSON.stringify(tbrinfo));
		var tbrArray = new Array();
		partyArray.push(tbrinfo);
		tbrArray.push(tbrinfo);
		var tbrJson = {"name":"tbrinfo","objjson":tbrArray};
		console.log("投保人年龄："+ageCf(tbrinfo.birthDate,new Date()));
		if(ageCf(tbrinfo.birthDate,new Date())<18){
			 hideLoad();
			mui.alert("投保人年龄需满18周岁，请修改");
			return;
		}
		var checksex=true;
		$("div[name='gender']").each(function(){
			var nowsex=$(this).hasClass("mui-active")==true?"男":"女";
			var cardtype=$(this).parent().parent().find("div[name='certificateType']").attr("value");
			var cardNum=$(this).parent().parent().find("input[name='certificateNum']").val();
			if($(this).is(":hidden")==false){
				if(cardtype=='1'){
					var sex=cardNuminfo(cardNum,2);
					if(nowsex!=sex){
						if($(this).parent().parent().attr("id")=="tbrinfo"){
							mui.alert("投保人性别与证件号不符");
							checksex=false;
							return;
						}
						if($(this).parent().parent().attr("id")=="mbbrinfo"){
							mui.alert("被保人性别与证件号不符");
							checksex=false;
							return;
						}
						if($(this).parent().parent().attr("id")=="ssyinfo"){
							mui.alert("受益人性别与证件号不符");
							checksex=false;
							return;
						}
					}
				}
			}
		})
		if(!checksex){
			 hideLoad();
			return;
		}
		var cardinfocheck=true;
		$("div[name='birthDate']").each(function(){
			var birthDate=$(this).html();
			var cardtype=$(this).parent().parent().find("div[name='certificateType']").attr("value");
			var cardNum=$(this).parent().parent().find("input[name='certificateNum']").val();
			if($(this).is(":hidden")==false){

				/* if(cardtype=='0'||cardtype=='4'||cardtype=='C'){
					var birthday=cardNuminfo(cardNum,1);
					if(birthDate!=birthday){
						if($(this).parent().parent().attr("id")=="tbrinfo"){
							mui.alert("投保人出生日期与证件号不符");
						}
						if($(this).parent().parent().attr("id")=="mbbrinfo"){
							mui.alert("被保人出生日期与证件号不符");
						}
						if($(this).parent().parent().attr("id")=="ssyinfo"){
							mui.alert("受益人出生日期与证件号不符");
						}
						cardinfocheck=false;
						return false;
					}
				} */
				if(cardtype=='1'){
					var birthday=cardNuminfo(cardNum,1);
					if(birthDate!=birthday){
						if($(this).parent().parent().attr("id")=="tbrinfo"){
							mui.alert("投保人出生日期与证件号不符");
							cardinfocheck=false;
							return false;
						}
						if($(this).parent().parent().attr("id")=="mbbrinfo"){
							mui.alert("被保人出生日期与证件号不符");
							cardinfocheck=false;
							return false;
						}
						if($(this).parent().parent().attr("id")=="ssyinfo"){
							mui.alert("受益人出生日期与证件号不符");
							cardinfocheck=false;
							return false;
						}

					}
				}
			}
		})
		if($('#fadingsyr').hasClass('mui-active')){
			console.log(1)
		}else{
			/* var earnLeng = $("input[name='earningRatio']").length;
			var earSum=0;
			 for(i=0;i<earnLeng;i++){
				 earSum +=Number($("input[name='earningRatio']").eq(i).val());

			 }
			 //console.log(earSum,11111111)
			 if(earSum != 100){
		       mui.alert("受益比例需为100%，请修改");
		       hideLoad();
				return false;
			 } */

			//sjx 2020-01-08 修改受益比例 计算逻辑
			var earnLeng = $("input[name='earningRatio']").length;
			var earSum=0;
			var earSumtwo=0;
			var syrshun="";
			var issyrsynposition = $('input:checkbox[name="syrsynposition"]:checked').val();
			for(i=0;i<earnLeng;i++){
				 earSum +=Number($("input[name='earningRatio']").eq(i).val());
				 earSumtwo = Number($("input[name='earningRatio']").eq(i).val());
				 if(issyrsynposition != null && earSumtwo != 100){
					 //mui.alert("顺位受益比例需为100%，请修改");
					 mui.alert("按顺位分配方式指定受益人时，各顺位受益人受益比例只能为100%");
				     hideLoad();
					 return false;
				 }
				 if(i == 0 && issyrsynposition != null){
					 syrshun = $("div[id='syposition']").eq(i).attr("value");
					 if(syrshun != "01"){
						 mui.alert("第一受益顺位选择有误!");
					     hideLoad();
						 return false;
					 }
				 }
				 if(i == 1 && issyrsynposition != null){
					 syrshun = $("div[id='syposition']").eq(i).attr("value");
					 if(syrshun != "02"){
						 mui.alert("第二受益顺位选择有误!");
					     hideLoad();
						 return false;
					 }
				 }
				 if(i == 2 && issyrsynposition != null){
					 syrshun = $("div[id='syposition']").eq(i).attr("value");
					 if(syrshun != "03"){
						 mui.alert("第三受益顺位选择有误!");
					     hideLoad();
						 return false;
					 }
				 }
				 //earSumtwo = Number($("input[name='earningRatio']").eq(i).val());
				 //if(issyrsynposition != null && earSumtwo != 100){

				 //}
			 }
			 if(earSum != 100 && issyrsynposition == null){
		       mui.alert("受益比例需为100%，请修改");
		       hideLoad();
				return false;
			 }
		}

		if(!cardinfocheck){
			 hideLoad();
			return;
		}

		if($('#reInsured').text()!='本人' && $('#reInsured').text()!='' ){
			var bage = ageCf($('#brbirday').text());
			var bVal = $('#bbrmobile').val();
			var bbrNameVal = $('#bbrname').val();
			var tbrMobileVal = $('#tbrmobile').val();
			var tbrNameVal = $('#tbrname').val();
			//console.log(bage,bVal,222222222)
			var rges =/^1[3|4|5|6|7|8|9]\d{9}$/;
			console.log(bage)

			//判断投被保险人手机号重复
			/* if(tbrNameVal != bbrNameVal){
				if(tbrMobileVal == bVal){
					mui.alert('投被保险人手机号重复 ,请重新确认');
					hideLoad();
					return false;
				}
			} */
			if(bage>18 || bage==18){
				if(!rges.test(bVal)|| bVal==''){
					mui.alert('被保人手机号有误');
					hideLoad();
					return false;
				}
			}else{
				if(!rges.test(bVal) && bVal !=''){
					mui.alert('被保人手机号有误');
					hideLoad();
					return false;
				}
			}
		}

		//sjx 2019-11-20 15:26 //新增--被保险人、受益人证件类型调整
		//start
		var bbrIdType = $('#brcardtype').attr("value");
		var bbrBirthday = $("#brbirday").text();
		var bbrIdNum = $("#bbrcardnum").val();
		var bbrBirthDay = ageCf(bbrBirthday);
		if(bbrIdType == 13 && bbrIdNum.length != 10){
			mui.alert('被保人证件号填写有误!');
			hideLoad();
			return false;
		}
		if(bbrIdType == 12 && bbrBirthDay >= 17){
			mui.alert('被保人17周岁以上，不能使用户口本投保!');
			hideLoad();
			return false;
		}
		if(bbrIdType == 13 && bbrBirthDay >= 2){
			mui.alert('被保人2周岁以上，不能使用出生证明投保!');
			hideLoad();
			return false;
		}
		if(bbrIdType == 12){
			var idValidity = $("#brcarddate").text()
			//获取出生日期--年
			var bbrBirthdayOne = bbrBirthday.split("-")[0];
			//计算获取应该有效期时间--年
			var bbrBirthdayTwo = parseInt(bbrBirthday.split("-")[0])+17;//2018
			//出生日期的年替换成应该有效期的年
			var bbrBirthdayThree = bbrBirthday.replace(bbrBirthdayOne,bbrBirthdayTwo);
			if(idValidity != bbrBirthdayThree){
				mui.alert('被保人户口本有效期必须是未成年人满17周岁的日期!');
				hideLoad();
				return false;
			}
		}
		if(bbrIdType == 13){
			var idValidity = $("#brcarddate").text()
			//获取出生日期--年
			var bbrBirthdayOne = bbrBirthday.split("-")[0];
			//计算获取应该有效期时间--年
			var bbrBirthdayTwo = parseInt(bbrBirthday.split("-")[0])+2;
			//出生日期的年替换成应该有效期的年
			var bbrBirthdayThree = bbrBirthday.replace(bbrBirthdayOne,bbrBirthdayTwo);
			if(idValidity != bbrBirthdayThree){
				mui.alert('被保人出生证明有效期必须是未成年人满2周岁的日期!');
				hideLoad();
				return false;
			}
		}

		var _isInvalid = true;
		$("div[id='ssbirday']").each(function(){
			var syrbirday = $(this).text();
			var syrcardtype = $(this).parent().parent().find("div[name='certificateType']").attr("value");
			var syrBirthDay = ageCf(syrbirday);
			if(syrcardtype == 12 && syrBirthDay >= 17){
				mui.alert('受益人17周岁以上，不能使用户口本投保!');
				hideLoad();
				_isInvalid = false;
				return false;
			}
			if(syrcardtype == 13 && syrBirthDay >= 2){
				mui.alert('受益人2周岁以上，不能使用出生证明投保!');
				hideLoad();
				_isInvalid = false;
				return false;
			}
			if(syrcardtype == 12){
				var syridValidity = $(this).parent().parent().find("div[name='certValidateEndDate']").text();
				//获取出生日期--年
				var syrBirthdayOne = syrbirday.split("-")[0];
				//计算获取应该有效期时间--年
				var syrBirthdayTwo = parseInt(syrbirday.split("-")[0])+17;//2018
				//出生日期的年替换成应该有效期的年
				var syrBirthdayThree = syrbirday.replace(syrBirthdayOne,syrBirthdayTwo);
				if(syridValidity != syrBirthdayThree){
					mui.alert('受益人户口本有效期必须是未成年人满17周岁的日期!');
					hideLoad();
					_isInvalid = false;
					return false;
				}
			}
			if(syrcardtype == 13){
				var syridValidity = $(this).parent().parent().find("div[name='certValidateEndDate']").text();
				//获取出生日期--年
				var syrBirthdayOne = syrbirday.split("-")[0];
				//计算获取应该有效期时间--年
				var syrBirthdayTwo = parseInt(syrbirday.split("-")[0])+2;
				//出生日期的年替换成应该有效期的年
				var syrBirthdayThree = syrbirday.replace(syrBirthdayOne,syrBirthdayTwo);
				if(syridValidity != syrBirthdayThree){
					mui.alert('受益人出生证明有效期必须是未成年人满2周岁的日期!');
					hideLoad();
					_isInvalid = false;
					return false;
				}
			}
		})
		if (!_isInvalid) {
			return false;
		}
		//end


		resultArray.push(tbrJson);
		//序列化被保人录入项信息
		var mbbrinfos = $("form[id='mbbrinfo']");
		var bbrArray = new Array();
		for(var i=0; i<mbbrinfos.length; i++){
			var o;
			if(tbrinfo.relateInsuredCode=="00"){
				o = JSON.parse(JSON.stringify(tbrinfo));
				o.partyType="2";//主被保人
			}else{
				if(i==0){
					o = $(mbbrinfos[i]).serializeParyForm("2");
				}else{
					o = $(mbbrinfos[i]).serializeParyForm("4");
				}
			}
			var bbrworkpostalCode = null;
			if(o.relateInsuredCode == "00"){
				bbrworkpostalCode = $("#tbrworkcode").val()
			}else{
				bbrworkpostalCode = $("#bbrworkcode").val();
			}
			o.workpostalCode = bbrworkpostalCode;
			//console.log(JSON.stringify(o))
			bbrArray.push(o);
			partyArray.push(o);
		}
		var bbrJson = {"name":"mbbrinfo","objjson":bbrArray};
		storage.set("bbrinfo",JSON.stringify(bbrArray));
		storage.set("tbrname",tbrinfo.name);
		storage.set("bbrname",bbrArray[0].name);
		resultArray.push(bbrJson);

		var fading = $("form[id='ssyinfo']").find("div[name='fading']").attr("class").indexOf("mui-active")!=-1?"1":"0";
		var ssrArray = new Array();
		var ssyinfos = $("form[id='ssyinfo']");

			//序列化受益人录入项信息
			for(var i=0; i<ssyinfos.length; i++){
				var o = $(ssyinfos[i]).serializeParyForm("3");

				//sjx 2020-01-07 新增受益人录入项判断
				//start
				if(fading != 1){
					var syrbirday = o.birthDate;
					var syrage = ageCf(syrbirday);
					if(syrage > 18 || syrage == 18){
						var syrmobile =  o.mobile;
						//if(fading != 1){
							if(syrmobile == "" || syrmobile == null){
								mui.alert('请填写受益人联系电话!');
								hideLoad();
								return false;
							}
						//}
					}

					var syrposdetail = o.contactAddrDetail;
					if(syrposdetail == "" || syrposdetail == null){
						mui.alert('请填写受益人详细地址!');
						hideLoad();
						return false;
					}
					if(o.syrsynposition == "N"){
						mui.alert('请勾选按比例或者按顺位!');
						hideLoad();
						return false;
					}
				}


				//end

				ssrArray.push(o);
				if(fading!="1"){
					partyArray.push(o);
				}
			}

		var ssrJson = {"name":"ssyinfo","objjson":ssrArray};
		resultArray.push(ssrJson);
		//console.log(resultArray);
		var resultInfoJson=controlToJson(jsondata,resultArray);
		var inputHostory={"productCode":"${productCode}","pagenum":"2","orderNo":getUrlParam("orderNo"),"inputData":resultInfoJson};

		if(partyArray[0].sm=="{}"){
			   mui.alert('请重新勾选个人税收居民身份声明文件');
			   hideLoad();
			   return false;
		}

		var workddr = partyArray[0].workAddrText;
		var workddr2 = partyArray[1].workAddrText;
		if(workddr.indexOf("-") != -1){
			var posdetailStr = workddr.split('-');
			var selectPosdetailVal = posdetailStr[0];
			var dwPosdetailInfoVal = posdetailStr[1];

			//获取投保人职业编码
			if(agentinfo.channel == '1'){
				var tbrCareerCode = partyArray[0].careerCode;
				let statuses = {'T01':'家庭主妇','T02':'保姆及钟点工','T03':'儿童','T04':'退休人员','Z01':'自由投资者','Z02':'待业人员','Z03':'临时工、无固定职业'};
				var result = statuses[tbrCareerCode];
				if(result == null){
					if(dwPosdetailInfoVal == "0"){
						mui.alert('请填写投保人单位/学校详细地址!');
						hideLoad();
						return false;
					}
				}
			}else{
				if(dwPosdetailInfoVal == "0"){
					mui.alert('请填写投保人单位/学校详细地址!');
					hideLoad();
					return false;
				}
			}

		}
		if(workddr2.indexOf("-") != -1){
			var posdetailStr = workddr2.split('-');
			var selectPosdetailVal = posdetailStr[0];
			var dwPosdetailInfoVal = posdetailStr[1];

			//获取被保人职业编码
			if(agentinfo.channel == '1'){
				var bbrCareerCode = partyArray[1].careerCode;
				let status = {'T01':'家庭主妇','T02':'保姆及钟点工','T03':'儿童','T04':'退休人员','Z01':'自由投资者','Z02':'待业人员','Z03':'临时工、无固定职业'};
				var resultTwo = status[bbrCareerCode];
				if(resultTwo == null){
					if(dwPosdetailInfoVal == "0"){
						mui.alert('请填写被保人单位/学校详细地址!');
						hideLoad();
						return false;
					}
				}
			}else{
				if(dwPosdetailInfoVal == "0"){
					mui.alert('请填写被保人单位/学校详细地址!');
					hideLoad();
					return false;
				}
			}

		}

		//sjx 2020-0429修复因被保人年收入为空导致信息确认页面生成预览投保单异常
		if(bbrBirthDay < 18){
			//console.log(partyArray[1].salary);
			var bbrSalary = partyArray[1].salary;
			if(bbrSalary == null || bbrSalary == ""){
				mui.alert('请填写被保人年收入!');
				hideLoad();
				return false;
			}
		}

        //tbrinfo
		var tbrinfo = $("#tbrinfo").serializeParyForm("1");
		var tbrName = tbrinfo.name;  //姓名
		var tbrIDType = tbrinfo.certificateType;  //证件类型
		var tbrbirthDate = tbrinfo.birthDate; //出生日期
		var tbrmobile = tbrinfo.mobile; //手机
		var tbrIDnum = tbrinfo.certificateNum;   //证件号
		var tbrAddressNum = tbrinfo.contactAddrProvince.split('-')[1]+"," + tbrinfo.contactAddrCity.split('-')[1]+"," + tbrinfo.contactAddrCounty.split('-')[1];  //地区编号
		var contactAddrProvince = tbrinfo.contactAddrProvince.split('-')[0];   //省
		var contactAddrCity = tbrinfo.contactAddrCity.split('-')[0];   //市
		var contactAddrCounty = tbrinfo.contactAddrCounty.split('-')[0];   //区
		var tbrSSQ = tbrinfo.contactAddrDetail;   //详细地址
		var tbrEmail = tbrinfo.postalCode;   //邮箱
		var tbrJob = tbrinfo.careerName;   //职业
		var tbrsex = tbrinfo.gender;   //性别
		var nationality = tbrinfo.nationality  //国籍
		var salary = tbrinfo.salary //年收入
		var height = tbrinfo.height;  //身高
		var weight = tbrinfo.weight;  //体重
		var maritalStatu = tbrinfo.maritalStatus;  //婚姻状况
		var agentCode = getUrlParam('agentCode');

		/* var custInfo = {
			'name':tbrName,
			'credentialType':tbrIDType,
			'birth':tbrbirthDate,
			'mobile':tbrmobile,
			'credentialNo':tbrIDnum,
			'locationCode':tbrAddressNum,
			'location':tbrSSQ,
			'address':tbrDetailAddress,
			'email':tbrEmail,
			'job':tbrJob,
			'gender':tbrsex,
			'salary':salary,
			'height':height,
			'weight':weight,
			'maritalStatu':maritalStatu,
			'agentcode':agentCode
		}; */
		/* return console.log(tbrinfo) */


		/*
			zf  凡是通过汇中渠道出单的代理人，客户身份证信息(投保人信息)录入校验是四川的身份证件，前端阻断并提示：不接受该地区客户的投保
			1.判断是否为汇中渠道   2.判断客户身份信息是否为投保人信息  3.判断投保人身份证证件是否是四川

		*/
		//获取机构号
		//20200413-去掉此规则-ljz
		/*var channelNum = agentinfo.agentCom;
		if((channelNum.substring(0,3)) == "J04"){
			if(tbrIDType == 1){
				if(tbrIDnum.substring(0,3) == '510'){
					mui.alert('不接受该地区客户的投保！')
					hideLoad();
					return false;
				   }
			  }
		  } */

		if(document.getElementById("zibaojian")){
			var updateOrd = {};
			updateOrd.orderNo = getUrlParam("orderNo");
			updateOrd.isZbj = $("#zibaojian").hasClass("mui-active")==true?"1":"0";
			$.ajax({
				type: "post",
				url: getRootPath()+"/order/updateOrder.do",
				data: {"order":JSON.stringify(updateOrd)},
				success:function(sss){
					console.log("修改自保件信息成功");
				},
				error:function(e){
					mui.alert("请求异常");
				}
			});
		}
		//2023-MT-0017_嘉兴双录地区
		if(document.getElementById("zbjhbj")){
			var updateOrd = {};
			updateOrd.orderNo = getUrlParam("orderNo");
			updateOrd.isZbj = $("#zbjhbj").hasClass("mui-active")==true?"1":"0";
			$.ajax({
				type: "post",
				url: getRootPath()+"/order/updateOrder.do",
				data: {"order":JSON.stringify(updateOrd)},
				success:function(sss){
					console.log("修改自保件/互保件信息成功");
				},
				error:function(e){
					mui.alert("请求异常");
				}
			});
		}

        if(agentinfo.channel == '1' || agentinfo.channel == '3'){
            // 检验实名手机号
            var tbrName=$('#tbrname').val();
            var tbrCardNum=$('#tbrcardnum').val();
            var mobile =$('#tbrmobile').val();
            $.ajax({
                type:'post',
                url: getRootPath()+"/order/mobileVerify.do",
                data: {
                    "name":tbrName,
                    "mobile":mobile,
                    'cerNo':tbrCardNum
                },
                success:function(msg){
                    hideLoad();
                    if(JSON.parse(msg).resultCode == '1'){
                        mobileVerify='1';
                        hideMobileRemark();
                    }else{
                        mobileVerify='0';
                        showMobileRemark();
                    }
                    // 将客户信息中的手机实名字段重新赋值
                    $.each(partyArray,function (idx,obj) {
                        obj.mobileVerify=mobileVerify;
                        obj.mobileRemark1=('1'==mobileVerify) ? '' : $("#trbmobileRemark1").val();
                        obj.mobileRemark2=('1'==mobileVerify) ? '' : $("#trbmobileRemark2").val();
                    });
                    // 将历史信息中的手机实名字段重新赋值
                    if(inputHostory && inputHostory.inputData){
                        // 更新投保人即可
                        $.each(inputHostory.inputData[0].objjson,function (idx,obj) {
                            if(obj.id == 'mobileVerify'){
                                obj.text=mobileVerify;
                            }
                            if(obj.id == 'trbmobileRemark1'){
                                obj.text=('1'==mobileVerify) ? '' : $("#trbmobileRemark1").val();
                            }
                            if(obj.id == 'trbmobileRemark2'){
                                obj.text=('1'==mobileVerify) ? '' : $("#trbmobileRemark2").val();
                            }
                        });
                    }

							// 提交前判断下手机实名
							if(mobileVerify =='0'){
								var trbmobileRemark1=$("#trbmobileRemark1").val();
								if(!trbmobileRemark1){
									mui.alert("请填写投保人手机号码非本人实名的原因!");
									return false;
								}
								var trbmobileRemark2=$("#trbmobileRemark2").val();
								if(!trbmobileRemark2){
									mui.alert("请提供此手机号码实名登记所有人的姓名、证件类型和证件号!");
									return false;
								}
							}
							$.ajax({
								type: "post",
								url: getRootPath()+"/order/insertOrderParty.do",
								data: {
									"partys":JSON.stringify(partyArray),
									"inputHostory":JSON.stringify(inputHostory),
									'agentcode':agentCode,
									'orderNo':getUrlParam("orderNo"),
									nextClick:'yes'
								},
								success:function(msg){
									hideLoad();
									//console.log(msg,8888888)
									if(JSON.parse(msg).resultCode != '1'){
										mui.alert(JSON.parse(msg).errorMessage);
									}else{
										post("/Insurance/riskinfo.do",{productId:"${productCode}",pagenum:1,agentCode:agentinfo.agentCode,'nextClick':'yes',"orderNo":getUrlParam("orderNo"),"sluflag":getUrlParam("sluflag"),"Flag":getUrlParam("Flag"),"id":getUrlParam("id"),"docsm":getUrlParam("docsm")});
									}
								}
							});
						}
					});
				}else{
					$.ajax({
						type: "post",
						url: getRootPath()+"/order/insertOrderParty.do",
						data: {
							"partys":JSON.stringify(partyArray),
							"inputHostory":JSON.stringify(inputHostory),
							'agentcode':agentCode,
							'orderNo':getUrlParam("orderNo"),
							nextClick:'yes'
						},
						success:function(msg){
							hideLoad();
							//console.log(msg,8888888)
							if(JSON.parse(msg).resultCode != '1'){
								mui.alert(JSON.parse(msg).errorMessage);
							}else{

								post("/Insurance/riskinfo.do",{productId:"${productCode}",pagenum:1,agentCode:agentinfo.agentCode,'nextClick':'yes',"orderNo":getUrlParam("orderNo"),"sluflag":getUrlParam("sluflag"),"Flag":getUrlParam("Flag"),"id":getUrlParam("id"),"docsm":getUrlParam("docsm")});
							}
						}
					});
				}
			}
		}
	}

}

//本人关系，隐藏被保人录入项
function hidebbr(){
	$(".insured_form").each(function(){
		$(this).hide();
	})
}
//非本人关系，显示被保人录入项
function showbbr(){
	$(".insured_form").each(function(){
		$(this).show();
	})
	/* if(proCode=='100040'&& jysflag=="JYS"){
		planBookBbr();//建议书被保人信息带出
	} */
}
//军官证隐藏个人税收
/* function hidegs(obj){
	$(obj).parent().parent().find("input[name='residentsText']").parent().hide();
} */
function showgs(obj){
	$(obj).parent().parent().find("input[name='residentsText']").parent().show();
}
function changepermposdetail(obj){
	if($(obj).parent().parent().find("input[id='samehj']").prop("checked")==true){
		$(obj).parent().parent().find("input[name='posdetail']").val($(obj).val());
	}
}
function changepermposdetailText(obj){
	var ssq=$(obj).parent().parent().find("div[name='permposition']").html();
	var ssqarr=ssq.split(" ");
	/* ssq=ssq.replace(/\s/g, "");*/
	var valueStr=$(obj).val();
	for(var i=0;i<ssqarr.length;i++){
		valueStr=valueStr.replace(ssqarr[i],"");
	}
	$(obj).val(valueStr.replace(ssq,""));
}
function changeposdetailText(obj){
	var ssq=$(obj).parent().parent().find("div[name='position']").html();
	var ssqarr=ssq.split(" ");
	/* ssq=ssq.replace(/\s/g, "");*/
	var valueStr=$(obj).val();
	for(var i=0;i<ssqarr.length;i++){
		valueStr=valueStr.replace(ssqarr[i],"");
	}
	$(obj).val(valueStr.replace(ssq,""));
}


function cancel(index){
	$($("form input[name='residentsText']")[index]).prop("checked",false);
	$("#shuoming").hide();
}


function suishousure(index){

	var flag=false;
	var typevalue="";
	$("input[name='residentsType']").each(function(){
		if($(this).prop("checked")==true){
			flag=true;
			typevalue=$(this).val();
		}
	})
	if(!flag){
		mui.alert("请选择税收居民类型");
		return;
	}

	if (typevalue != "1") {
		var kongflag = false;
		$("input[name='taxcountyandnos']").each(function () {
			if ($(this).val() != "") {
				kongflag = true;
				return false;
			}
		})


		if ($("input[name='xing']").val() == "") {
			mui.alert("请输入姓(英文或拼音)");
			return false;
		}
		if ($("input[name='ming']").val() == "") {
			mui.alert("请输入名(英文或拼音)");
			return false;
		}

		for (var i = 0; i < $(".addr").length; i++) {
			if ($(".addr").eq(i).val() == '') {
				mui.alert($(".addr").eq(i).data("checktips"));
				$(".addr").eq(i).focus();
				return false;
			}
		}

		var nationality = $("#nationality").attr("value");
		if(nationality != "CHN"){
			if ($("input[name='placeofbirthchn2']").val() == "" || $("input[name='placeofbirthchn3']").val() == "") {
				mui.alert("请选择省市");
				return false;
			}
			if ($("input[name='birthAddress']").val() == "") {
				mui.alert("请输入详细地址");
				return false;
			}

		}

		for (var i = 0; i < $(".taxinfo").length; i++) {
			if (!$(".taxinfo").eq(i).is(':hidden')) {
				var noneflag = false;
				$(".notshu").eq(i).each(function () {
					if ($(this).prop("checked") == true) {
						noneflag = true;
						return false;
					}
				})
				$(".no-get").eq(i).each(function () {
					if ($(this).prop("checked") == true) {
						noneflag = true;
						return false;
					}
				})

				if ($('.taxCounty').eq(i).val() == '') {
					mui.alert("请输入税收居民国(地区)");
					return;
				}

				if (!noneflag && $('.taxNum').eq(i).val() == '') {
					if ($("input[name='notshuishoutext']").eq(i).val() == "") {
						mui.alert("如不能提供纳税人识别号，请选择原因！");
						return;
					}
				}
				if ($('.no-get').eq(i).prop("checked") == true && $('.reason_not').eq(i).val() == '') {
					mui.alert("请解释具体原因");
					return false;
				}
			}
		}

	}
	/* if(!$("#7_"+(index+1)).attr("src")){
		mui.alert("请签名");
		return ;
	} */

	if ($('#tongyiCheck').prop("checked") == false) {
		mui.alert("请勾选本人声明内容");
		return false;
	}

	var oldindex=index;
	var getnscode = function(){
		var ecode = $('input[name="taxcountyandnos"]');
		var nscode = "";
		ecode.each(function(i,e){
			nscode += $(e).val() +",";
		});
		return nscode;
	}
	$("input[name='residentsType']").each(function(){
		var _self=$(this);
		if($(_self).prop("checked")==true){
			//临时写法，长生只有投保人有税收类型
			var username = $('input[name="username"]').val();
			var xing = $('input[name="xing"]').val()?$('input[name="xing"]').val():"";
			var ming = $('input[name="ming"]').val()?$('input[name="ming"]').val():"";
			var sm = {};
			sm.orderNo=getUrlParam("orderNo");
			sm.partyName=username+","+xing+","+ming;
			sm.residentsType = $(_self).val();
			if($(this).prop("checked")==true){
				sm.residentsType = $(_self).val();
			}
			sm.homeaddresschn = $('input[name="homeaddresschn"]').val()+","+$('input[name="homeaddresschn2"]').val()+","+$('input[name="homeaddresschn3"]').val()+","+$('input[name="detailAddress"]').val();
			sm.homeaddressen = $('input[name="homeaddressen"]').val()+","+$('input[name="homeaddressen2"]').val()+","+$('input[name="homeaddressen3"]').val()+","+$('input[name="endetailAddress"]').val();
			sm.placeofbirthchn = $('input[name="placeofbirthchn"]').val()+","+$('input[name="placeofbirthchn2"]').val()+","+$('input[name="placeofbirthchn3"]').val()+","+$('input[name="birthAddress"]').val();
			sm.placeofbirthen = $('input[name="placeofbirthen"]').val()+","+$('input[name="placeofbirthen2"]').val()+","+$('input[name="placeofbirthen3"]').val()+","+$('input[name="enbirthAddress"]').val();
			var taxcountyandnos = '';
			var notaxnoreasons = '';
			var notaxnoreasondetails = '';
			for (var i = 0; i < $(".taxinfo").length; i++) {
				if (!$(".taxinfo").eq(i).is(':hidden')) {
					var noneflag = false;
					taxcountyandnos += $('.taxCounty').eq(i).val() + '|' + $('.taxNum').eq(i).val() + ',';

					$(".notshu").eq(i).each(function () {
						if ($(this).prop("checked") == true) {
							notaxnoreasons += $(this).val() + ',';
							noneflag = true;
						}
					})
					$(".no-get").eq(i).each(function () {
						if ($(this).prop("checked") == true) {
							notaxnoreasons += $(this).val() + ',';
							noneflag = true;
						}
					})

					if(!noneflag){
						notaxnoreasons += ',';
					}

					notaxnoreasondetails += $('input[name="notshuishoutext"]').eq(i).val() + ',';

				}
			}
			taxcountyandnos = taxcountyandnos.substr(0, taxcountyandnos.length - 1);
			// notaxnoreasons = notaxnoreasons.substr(0, notaxnoreasons.length - 1);
			// notaxnoreasondetails = notaxnoreasondetails.substr(0, notaxnoreasondetails.length - 1);

			console.log(taxcountyandnos);
			console.log(notaxnoreasons);
			console.log(notaxnoreasondetails);
			sm.taxcountyandnos = taxcountyandnos;
			sm.notaxnoreason = notaxnoreasons;
			sm.notaxnoreasondetail = notaxnoreasondetails;

			// sm.taxcountyandnos = getnscode();
			// sm.notaxnoreasondetail =$('input[name="notshuishoutext"]').val();
			// $("input[name='notshuishou']").each(function(){
			// 	if($(this).prop("checked")==true){
			// 		sm.notaxnoreason = $(this).val();
			// 	}
			// })

			$($("form input[name='residentsText']")[oldindex]).val(JSON.stringify(sm));


		}
	})
	var name=$($("form input[name='residentsText']")[oldindex]).parent().parent().find("input[name='name']").val();
	var orderNo=getUrlParam("orderNo");
	var content=$("#shuoming").html();
	var parames={"name":name+"-"+oldindex,"orderNo":orderNo,"content":content};

	$.ajax({
		url:'../Insurance/residentsTextSave.do',
		type:'post',
		dataType:'json',
		data:parames,
		error: function(statu){
			alert('error');
		},
		success:function(data){
			$("#shuoming").hide();
		}
	});

}
	function Relations(text){
		$(".insured_form").each(function(){
			var obj=$(this).find("div[name='relateInsured']");
			if(text=="00"){
				$(obj).attr("selectdata",JSON.stringify(re_self));
			}else if(text=="07"){
				$(obj).attr("selectdata",JSON.stringify(re_zf));
			}
			else if(text=="08"){
				$(obj).attr("selectdata",JSON.stringify(re_zm));
			}
			else if(text=="09"){
				$(obj).attr("selectdata",JSON.stringify(re_sz));
			}
			else if(text=="10"){
				$(obj).attr("selectdata",JSON.stringify(re_sn));
			}
			else if(text=="11"){
				$(obj).attr("selectdata",JSON.stringify(re_wzf));
			}
			else if(text=="12"){
				$(obj).attr("selectdata",JSON.stringify(re_wzm));
			}
			else if(text=="13"){
				$(obj).attr("selectdata",JSON.stringify(re_ws));
			}
			else if(text=="14"){
				$(obj).attr("selectdata",JSON.stringify(re_wsn));
			}
			else if(text=="15"){
				$(obj).attr("selectdata",JSON.stringify(re_gg));
			}
			else if(text=="16"){
				$(obj).attr("selectdata",JSON.stringify(re_jj));
			}
			else if(text=="17"){
				$(obj).attr("selectdata",JSON.stringify(re_dd));
			}
			else if(text=="18"){
				$(obj).attr("selectdata",JSON.stringify(re_mm));
			}
			else if(text=="19"){
				$(obj).attr("selectdata",JSON.stringify(re_gonggong));
			}
			else if(text=="20"){
				$(obj).attr("selectdata",JSON.stringify(re_popo));
			}
			else if(text=="21"){
				$(obj).attr("selectdata",JSON.stringify(re_yf));
			}
			else if(text=="22"){
				$(obj).attr("selectdata",JSON.stringify(re_ym));
			}
			else if(text=="23"){
				$(obj).attr("selectdata",JSON.stringify(re_erx));
			}
			else if(text=="24"){
				$(obj).attr("selectdata",JSON.stringify(re_nx));
			}
			else if(text=="28"){
				$(obj).attr("selectdata",JSON.stringify(re_gz));
			}
			else if(text=="29"){
				$(obj).attr("selectdata",JSON.stringify(re_gy));
			}
			else if(text=="31"){
				$(obj).attr("selectdata",JSON.stringify(re_fm));
			}
			else if(text=="32"){
				$(obj).attr("selectdata",JSON.stringify(re_zn));
			}else if(text=="25"){
				$(obj).attr("selectdata",JSON.stringify(re_qtqs));
			}else if(text=="26"){
				$(obj).attr("selectdata",JSON.stringify(re_ts));
			}else if(text=="27"){
				$(obj).attr("selectdata",JSON.stringify(re_py));
			}else if(text=="33"){
				$(obj).attr("selectdata",JSON.stringify(re_po));
			}else if(text=="30"){
				$(obj).attr("selectdata",JSON.stringify(re_qt));
			}else if(text=="99"){
				$(obj).attr("selectdata",JSON.stringify(re_jd));
			}else{
				$(obj).attr("selectdata",JSON.stringify(re_all));
			}
			$(obj).html(JSON.parse($(obj).attr("selectdata"))[0].text);
			$(obj).attr("value",JSON.parse($(obj).attr("selectdata"))[0].value);
			$(obj).attr("data-value",JSON.parse($(obj).attr("selectdata"))[0].value);
		})
	}

	//调用摄像头拍照
	function sendimg(obj) {
	var imgObjPreviewsrc = window.URL.createObjectURL(obj.files.item(0));
	var image = new Image();
	image.crossOrigin = 'Anonymous';
	image.src = imgObjPreviewsrc;
	if(image.complete) {
		callback();
	} else {
		image.onload = callback;
	}

	function callback() {
		showLoad();
		var img = compress(image);
		//调用上传图片方法
		var imgupload="";

		imgupload=img.replace("data:image/jpeg;base64,","");

		imgupload=imgupload.replace("data:image/png;base64,","");

		imgupload=imgupload.replace("data:image/gif;base64,","");

		upload(imgupload,obj,$(obj).attr("cardType"),"/ocr2.do");
		img = null;
	}
	//图片 压缩
	function compress(img) {
		//    用于压缩图片的canvas
		var canvas = document.createElement("canvas");
		var ctx = canvas.getContext('2d');
		//    瓦片canvas
		var tCanvas = document.createElement("canvas");

		var tctx = tCanvas.getContext("2d");
		var initSize = img.src.length;
		var width = img.width;
		var height = img.height;
		//如果图片大于四百万像素，计算压缩比并将大小压至400万以下
		var ratio;
		if((ratio = width * height / 4000000) > 1) {
			ratio = Math.sqrt(ratio); //取平方根
			width /= ratio;
			height /= ratio;
		} else {
			ratio = 1;
		}
		canvas.width = width;
		canvas.height = height;
		//        铺底色
		ctx.fillStyle = "#fff";
		ctx.fillRect(0, 0, canvas.width, canvas.height);
		//如果图片像素大于100万则使用瓦片绘制
		var count;
		if((count = width * height / 1000000) > 1) {
			count = ~~(Math.sqrt(count) + 1); //计算要分成多少块瓦片
			//            计算每块瓦片的宽和高
			var nw = ~~(width / count);
			var nh = ~~(height / count);
			tCanvas.width = nw;
			tCanvas.height = nh;
			for(var i = 0; i < count; i++) {
				for(var j = 0; j < count; j++) {
					tctx.drawImage(img, i * nw * ratio, j * nh * ratio, nw * ratio, nh * ratio, 0, 0, nw, nh);
					ctx.drawImage(tCanvas, i * nw, j * nh, nw, nh);
				}
			}
		} else {
			ctx.drawImage(img, 0, 0, width, height);
		}
		//进行最小压缩
		var ndata = canvas.toDataURL('image/jpeg', ratio);
		//var ndata = canvas.toDataURL("image/"+ext);
		console.log('压缩前：' + initSize + '压缩后：' + ndata.length + '压缩率：' + ~~(100 * (initSize - ndata.length) / initSize) + "%");
		tCanvas.width = tCanvas.height = canvas.width = canvas.height = 0;
		return ndata;
	}
}
	//data 识别出的数据,obj ocr document对象, type 1银行卡 2正面 3反面
	function upload(data,obj,ocrtype,action){
		/* showLoad(); */
		var dir=$(obj).parent().attr("dir");
		var type=$(obj).attr("data-type");
		var imgdata=data;
		if(action=="/ocr2.do"){
			imgdata=data;
		}
		if(action=="/ocr.do"){
			imgdata=data.info.fullImg;
		}
		 jQuery.ajax({
			url:getRootPath()+action,
			data:{"img":imgdata,"orderNo":getUrlParam("orderNo"),"dir":dir,"type":type,"flag":ocrtype},
			type:"post",
			dataType:'json',
			success:function(msg){
				hideLoad();
				//调用ocr识别方法
				try{
					if(action=="/ocr.do"){
						if(data.info.code){//正面// && data.data.facade=="0"
							$(obj).parents("form").find("input[name='name']").val(data.info.name);
							$(obj).parents("form").find("div[name='certificateType']").attr("value","1");
							$(obj).parents("form").find("div[name='certificateType']").html("身份证");
							if($(obj).parents("form").find("div[name='birthDate']").attr("jysflag")!="true"){
								if(data.info.birth.indexOf("年")!=-1){
									$(obj).parents("form").find("div[name='birthDate']").html(data.info.birth.replace("年","-").replace("月","-").replace("日",""));
								}else{
									var birth=data.info.birth;
									$(obj).parents("form").find("div[name='birthDate']").html(birth.substring(0,4)+"-"+birth.substring(4,6)+"-"+birth.substring(6,birth.length));
								}
							}
							$(obj).parents("form").find("input[name='certificateNum']").val(data.info.code);
							/* id_card_area.getAreaByIdCard(data.content.CardNo,$(obj).parents("form").find("input[name='certificateNum']"));
							var addr = id_card_area.getDetailAddr(data.content.Address); */
							var address=data.info.address;
							if(address.indexOf("省")!=-1){
								address=address.substring(address.indexOf("省")+1,address.length);
							}
							if(address.indexOf("市")!=-1){
								address=address.substring(address.indexOf("市")+1,address.length);
							}
							if(address.indexOf("区")!=-1){
								address=address.substring(address.indexOf("区")+1,address.length);
							}
							$(obj).parents("form").find("input[name='permposdetail']").val(address);
							var sex = data.info.gender;
							if(!$(obj).parents("form").find("div[name='gender']").hasClass("mui-disabled")){
								if(sex=='男'){
									$(obj).parents("form").find("div[name='gender']").addClass("mui-active");
								}else{
									$(obj).parents("form").find("div[name='gender']").removeClass("mui-active");
								}
							}
							$(obj).parents("form").find("input[name='certificateNum']").blur();
						}else if(!data.info.code){//反面// && data.data.facade=="1"
							var ocrDate = data.info.valid;
							var temp = ocrDate.split("-")[1];
							//temp = temp.replace(new RegExp("[.]", "gm"),"-");
							temp = temp.substring(0,4)+"-"+temp.substring(4,6)+"-"+temp.substring(6,8);
							if(temp=="长期"){
								temp="9999-12-31";
							}
							$(obj).parents("form").find("div[name='certValidateEndDate']").html(temp);
							/* $(obj).parents("form").find("div[name='certValidateEndDate']").removeClass("active"); */
							$(obj).parents("form").find("input[name='checkbox1']").prop("checked",false);
							$(obj).parents("form").find("div[name='certificateType']").attr("value","1");
							$(obj).parents("form").find("div[name='certificateType']").html("身份证");
							if(!$(obj).parents("form").find("div[name='certValidateEndDate']").hasClass("select_validity")){
								$(obj).parents("form").find("div[name='certValidateEndDate']").addClass("select_validity");
							}
						}else{
							mui.alert("识别失败");
						}
					}
					if(action=="/ocr2.do"){
							if(msg.resultCode=="1"){
								//反面
								var ocrDate = JSON.parse(msg.responseObject);
								if(typeof(ocrDate.cardNo)=="undefined"){
									if(ocrDate.expiryDates=="长期"){
										$(obj).parents("form").find("div[name='certValidateEndDate']").html("9999-12-31");
										$(obj).parents("form").find("input[name='checkbox1']").prop("checked",true);

									}else{
										$(obj).parents("form").find("div[name='certValidateEndDate']").html(ocrDate.expiryDates);
										$(obj).parents("form").find("input[name='checkbox1']").prop("checked",false);
									}
									/* $(obj).parents("form").find("div[name='certValidateEndDate']").removeClass("active"); */
									$(obj).parents("form").find("div[name='certificateType']").attr("value","1");
									$(obj).parents("form").find("div[name='certificateType']").html("身份证");
									if(!$(obj).parents("form").find("div[name='certValidateEndDate']").hasClass("select_validity")){
										$(obj).parents("form").find("div[name='certValidateEndDate']").addClass("select_validity");
									}
								}else{
									//正面
									$(obj).parents("form").find("input[name='name']").val(ocrDate.name);
									$(obj).parents("form").find("div[name='certificateType']").attr("value","1");
									$(obj).parents("form").find("div[name='certificateType']").html("身份证");
									if($(obj).parents("form").find("div[name='birthDate']").attr("jysflag")!="true"){
										$(obj).parents("form").find("div[name='birthDate']").html(ocrDate.birthday);
									}
									$(obj).parents("form").find("input[name='certificateNum']").val(ocrDate.cardNo);
									/* id_card_area.getAreaByIdCard(data.content.CardNo,$(obj).parents("form").find("input[name='certificateNum']"));
									var addr = id_card_area.getDetailAddr(data.content.Address); */
									var address=ocrDate.address;
									if(address.indexOf("省")!=-1){
										address=address.substring(address.indexOf("省")+1,address.length);
									}
									if(address.indexOf("市")!=-1){
										address=address.substring(address.indexOf("市")+1,address.length);
									}
									if(address.indexOf("区")!=-1){
										address=address.substring(address.indexOf("区")+1,address.length);
									}
									$(obj).parents("form").find("input[name='permposdetail']").val(address);
									var sex = ocrDate.sex;
									if(!$(obj).parents("form").find("div[name='gender']").hasClass("mui-disabled")){
										if(sex=='男'){
											$(obj).parents("form").find("div[name='gender']").addClass("mui-active");
										}else{
											$(obj).parents("form").find("div[name='gender']").removeClass("mui-active");
										}
									}
									$(obj).parents("form").find("input[name='certificateNum']").blur();
								}

							}else{
								mui.alert("识别失败");
							}

					}
				}catch(e){
					mui.alert("识别失败");
				}

			}

		})
	}
	function setupWebViewJavascriptBridge(callback) {
	    if (window.WebViewJavascriptBridge) { return callback(WebViewJavascriptBridge); }
	    if (window.WVJBCallbacks) { return window.WVJBCallbacks.push(callback); }
	    window.WVJBCallbacks = [callback];
	    var WVJBIframe = document.createElement('iframe');
	    WVJBIframe.style.display = 'none';
	    WVJBIframe.src = 'wvjbscheme://__BRIDGE_LOADED__';
	    document.documentElement.appendChild(WVJBIframe);
	    setTimeout(function() { document.documentElement.removeChild(WVJBIframe) }, 0)
	}
	/*var openid = localStorage.getItem('openid')
	function returnIndex(){
		toUrl("/agentwap/Skip/index.do?openid=" + openid);
		setupWebViewJavascriptBridge(function(bridge) {
		    /!* Initialize your app here 所有与iOS交互的JS代码放这里！*!/
		    bridge.callHandler('returnIndex',
                 {'resultCode':'1','errorMessage':'','requestObject':''},
                 function callback(response) {
                 	console.log('JS got response', response);

                 }
			)
		})
	}*/
	function mobileOcr(ele,type){
		if (!isWeiXin()) {
			try {
				setupWebViewJavascriptBridge(function(bridge) {
					/* Initialize your app here 所有与iOS交互的JS代码放这里！*/
					var param={
						responseObject : {"key":"1"}
					};
					bridge.callHandler('checkPermission',param,
							function callback(response) {
								//mui.alert(response);
							}
					)
				})
			}catch (e){
				console.log("相机权限判断异常")
			}
		}
		$(ele).click();
		return;
		if (!isWeiXin()) {
			try{
				setupWebViewJavascriptBridge(function(bridge) {
				    /* Initialize your app here 所有与iOS交互的JS代码放这里！*/
				    bridge.callHandler('openOcr',{'type':type},
		                 function callback(response) {
				    		//mui.alert(response);
		                 	upload(JSON.parse(response),ele,type,"/ocr.do");
		                 }
					)
				})
			}catch(e){
				mui.alert("OCR功能异常,请手动输入");
				//$(ele).click();
			}
		}else{
			$(ele).click();
		}
	}
	function upPage(){
		var channel = localStorage.getItem("channel");
		if (channel == 1 || channel == 2) {
			//可回溯强制上报
			rrwebsdk.leaveReport(function (state) {
				if (state) {
					submissions();
				} else {
					mui.alert(rrwebsdkErrors); // 强制上报失败，自行处理异常
					rrwebsdk.restoreReport(); // 开始录制
				}
			});
		}else{
			submissions();
		}

		function submissions(){
			self.location=document.referrer;
			setupWebViewJavascriptBridge(function(bridge) {
				/* Initialize your app here 所有与iOS交互的JS代码放这里！*/
				bridge.callHandler('popToPreView',
						{'resultCode':'1','errorMessage':'','responseObject':{popLevel:'1',needRefresh:'0',url:''}},
						function callback(response) {
							console.log('JS got response', response);

						}
				)

			})
		}
	}



 	$(function () {
		$("input[name='checkbox1']").parent().attr('id','time_box');



 		proCode = getUrlParam('productCode');
 		flag = getUrlParam('Flag');
 		//localStorage.setItem("shareIn",'getUrlParam("shareIn")')
 		//console.log(shareID,123456789)






 		/* 受益人与投保人性别校验 */
		$('#ssrsex').parent().find('.mui-switch-handle').click(function(){
			if($("#tbrsex").attr("class").indexOf('mui-active')==-1 && $("#ssrsex").attr("class").indexOf('mui-active')==-1){
				$('#ttbr').prop("checked",true);
			}else if($("#tbrsex").attr("class").indexOf('mui-active') !=-1 && $("#ssrsex").attr("class").indexOf('mui-active') !=-1){
				$('#ttbr').prop("checked",true);
			}else{
				$('#ttbr').prop("checked",false);
			}
 	 	})
		$("input[name='posdetail']").attr('class','mui-text-right posdeStyle')
		$("input[name='posdetail']").prev().css('width','0');

		 $('#bbrmobile').removeAttr('checkFlag');
		 $('#bbrwidth').removeAttr('checkflag');
		  $('#bbrwidth').blur(function(){
			var re =/^(?!(0[0-9]{0,}$))[0-9]{1,}[.]{0,}[0-9]{0,}$/;
			　　if(!re.test($(this).val())){
			　　　　mui.alert($(this).attr("checkTips"));
			　　}
		  })




		  function clearNoNum(obj){
			  obj.value = obj.value.replace(/[^\d.]/g,"");  //清除“数字”和“.”以外的字符
			  obj.value = obj.value.replace(/\.{2,}/g,"."); //只保留第一个. 清除多余的
			  obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
			  obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3');//只能输入两个小数
			  if(obj.value.indexOf(".")< 0 && obj.value !=""){//以上已经过滤，此处控制的是如果没有小数点，首位不能为类似于 01、02的金额
			   obj.value= parseFloat(obj.value);
			  }
			}

		  $("input[name='weight']").bind("input",function(){
			  clearNoNum(this)
		  })

	})
 	   noShare()
        function noShare(){
            document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
                  // 通过下面这个API隐藏右上角按钮
                WeixinJSBridge.call('hideOptionMenu');
            });
        }

 	//sjx  2020-01-07新增同投保人联系地址和同被保人联系地址
 	//start
 	$(function() {
 	    $('input[name="tongtbraddress"]').on('click', function() {

 	    	var tongtbraddressNum = $("form[id='ssyinfo']");

 	    	//var tongtbraddressFlag = $('input:checkbox[name="tongtbraddress"]:checked').val();
 	    	var tongtbraddressFlag = $(this).parents("form.ssyinfo").find('input:checkbox[name="tongtbraddress"]:checked').val();

 	    	//var tongbbraddressFlag = $('input:checkbox[name="tongbbraddress"]:checked').val();
 	    	var tongbbraddressFlag = $(this).parents("form.ssyinfo").find('input:checkbox[name="tongbbraddress"]:checked').val();
 	    	if(tongbbraddressFlag == "on"){
				//$('input:checkbox[name="tongbbraddress"]:checked').attr("checked",false)
				$(this).parents("form.ssyinfo").find('input:checkbox[name="tongbbraddress"]:checked').attr("checked",false)
 	    	}else if(tongbbraddressFlag == ""){
 	    		//$('input:checkbox[name="tongbbraddress"]:checked').attr("checked",false)
 	    		$(this).parents("form.ssyinfo").find('input:checkbox[name="tongbbraddress"]:checked').attr("checked",false)
 	    	}else if(tongbbraddressFlag == "T" || tongbbraddressFlag == "B"){
 	    		//$('input:checkbox[name="tongbbraddress"]:checked').attr("checked",false)
 	    		$(this).parents("form.ssyinfo").find('input:checkbox[name="tongbbraddress"]:checked').attr("checked",false)
 	    	}

 	    	if($(this).prop("checked")==true){
 	    		var tbrpostval=$("#tbrloc").attr("value");
 	 			var tbrposition=$("#tbrloc").text();
 	 			var tbrposdetail=$("#trbposdetail").val();
 	 			//if(tbrpostval==""||tbrposdetail==""){
 	 			if(tbrposdetail=="" || tbrposdetail == null){
 	 				$(this).prop("checked",false);
 	 				mui.alert('请填写投保人联系地址');
 	 				return false
 	 			}else{
 	 				/* $(this).parents("form.ssyinfo").find("div[name='position']").addClass("active");
	 	 			$(this).parents("form.ssyinfo").find("div[name='position']").attr("value",tbrpostval);
	 	 			$(this).parents("form.ssyinfo").find("div[name='position']").text(tbrposition);
	 	 			$(this).parents("form.ssyinfo").find("input[name='posdetail']").val(tbrposdetail);	 */
 	 				if(tbrposition.indexOf("浙江省") != -1){
						$(this).parent().parent().find("div[name='dtown']").remove();
						$(this).parent().parent().find("div[name='dcountryside']").remove();
						//$(this).parent().next().next().after('<div class="mui-input-row country country_div_class" name="dcountryside"><label><span></span></label><input type="text" placeholder="请录入村" class="mui-text-right" data-value="countryside" id="countryside" name="countryside"  checkrul="/^[\\u4e00-\\u9fa5（）()]{1,30}$|^[\\dA-Za-z（）()]{10,}$|^[\\dA-Za-z\\u4e00-\\u9fa5（）()]{1,25}$|^[A-Za-z\\u4e00-\\u9fa5（）()\d]{1,30}$/" checktips="投保人村输入有误" maxlength="10" onblur="changeposdetailText(this);"></div>');
						//$(this).parent().next().next().after('<div class="mui-input-row townn townn_div_class" name="dtown"><label><span></span></label><input type="text" placeholder="请录入镇" class="mui-text-right" data-value="town" id="town" name="town"  checkrul="/^[\\u4e00-\\u9fa5（）()]{1,30}$|^[\\dA-Za-z（）()]{10,}$|^[\\dA-Za-z\\u4e00-\\u9fa5（）()]{1,25}$|^[A-Za-z\\u4e00-\\u9fa5（）()\\d]{1,30}$/" checktips="投保人镇输入有误" maxlength="10" onblur="changeposdetailText(this);"></div>');
						var town=$("#tbrinfo").find("input[name='town']").val();
						var countryside=$("#tbrinfo").find("input[name='countryside']").val();
						$(this).parent().parent().find("input[name='town']").val(town);
						$(this).parent().parent().find("input[name='countryside']").val(countryside);
					}else{
						$(this).parent().parent().find("div[name='dtown']").remove();
						$(this).parent().parent().find("div[name='dcountryside']").remove();
					}
					/* $("#bbrloc").addClass("active");
					$("#bbrloc").attr("value",tbrpostval);
					$("#bbrloc").text(tbrposition);
					$("#bbrposdetail").val(tbrposdetail);
					$("#bbrzipcode").val($("#tbrzipcode").val()) */
					$(this).parents("form.ssyinfo").find("div[id='syrloc']").addClass("active");
					$(this).parents("form.ssyinfo").find("div[id='syrloc']").attr("value",tbrpostval);
					$(this).parents("form.ssyinfo").find("div[id='syrloc']").text(tbrposition);
					$(this).parents("form.ssyinfo").find("input[id='syrposdetail']").val(tbrposdetail);
					//$(this).parents("form.ssyinfo").find("div[id='syrloc']").addClass("active");
 	 			}
 	    	}
 	    	if($(this).prop("checked")==false){
 	    		$(this).parents("form.ssyinfo").find("div[name='position']").removeClass("active");
 	    		$(this).parents("form.ssyinfo").find("div[name='position']").attr("value","");
 	    		$(this).parents("form.ssyinfo").find("div[name='position']").text("请选择省市");
 	    		$(this).parents("form.ssyinfo").find("input[name='posdetail']").val("");
 	    		$(this).parents("form.ssyinfo").find("div[name='dtown']").remove();
				$(this).parents("form.ssyinfo").find("div[name='dcountryside']").remove();
 	    	}

 	    });

 	   $('input[name="tongbbraddress"]').on('click', function() {
 		  	//var tongbbraddressFlag = $('input:checkbox[name="tongbbraddress"]:checked').val();
 		  	var tongbbraddressFlag = $(this).parents("form.ssyinfo").find('input:checkbox[name="tongbbraddress"]:checked').val();

	    	//var tongtbraddressFlag = $('input:checkbox[name="tongtbraddress"]:checked').val();
	    	var tongtbraddressFlag = $(this).parents("form.ssyinfo").find('input:checkbox[name="tongtbraddress"]:checked').val();
	    	if(tongtbraddressFlag == "on"){
	    		//$('input:checkbox[name="tongtbraddress"]:checked').attr("checked",false)
	    		$(this).parents("form.ssyinfo").find('input:checkbox[name="tongtbraddress"]:checked').attr("checked",false)
	    	}else if(tongtbraddressFlag == ""){
	    		//$('input:checkbox[name="tongtbraddress"]:checked').attr("checked",false)
	    		$(this).parents("form.ssyinfo").find('input:checkbox[name="tongtbraddress"]:checked').attr("checked",false)
	    	}else if(tongtbraddressFlag == "B" || tongtbraddressFlag == "T"){
	    		//$('input:checkbox[name="tongtbraddress"]:checked').attr("checked",false)
	    		$(this).parents("form.ssyinfo").find('input:checkbox[name="tongtbraddress"]:checked').attr("checked",false)
	    	}

	    	if($(this).prop("checked")==true){
 	 			var tbreInsured = $("#reInsured").attr("value")
 	 			if(tbreInsured == "00"){
 	 				var tbrpostval=$("#tbrloc").attr("value");
 	 	 			var tbrposition=$("#tbrloc").text();
 	 	 			var tbrposdetail=$("#trbposdetail").val();

 	 				if(tbrposdetail=="" || tbrposdetail == null){
 	 	 				$(this).prop("checked",false);
 	 	 				mui.alert('请填写投保人联系地址');
 	 	 				return false;
 	 	 			}else{
 	 	 				/* $(this).parents("form.ssyinfo").find("div[name='position']").addClass("active");
 	 	 				$(this).parents("form.ssyinfo").find("div[name='position']").attr("value",tbrpostval);
 	 	 				$(this).parents("form.ssyinfo").find("div[name='position']").text(tbrposition);
 	 	 				$(this).parents("form.ssyinfo").find("input[name='posdetail']").val(tbrposdetail); */
 	 	 				if(tbrposition.indexOf("浙江省") != -1){
 							$(this).parent().parent().find("div[name='dtown']").remove();
 							$(this).parent().parent().find("div[name='dcountryside']").remove();
 							//$(this).parent().next().after('<div class="mui-input-row country country_div_class" name="dcountryside"><label><span></span></label><input type="text" placeholder="请录入村" class="mui-text-right" data-value="countryside" id="countryside" name="countryside"  checkrul="/^[\\u4e00-\\u9fa5（）()]{1,30}$|^[\\dA-Za-z（）()]{10,}$|^[\\dA-Za-z\\u4e00-\\u9fa5（）()]{1,25}$|^[A-Za-z\\u4e00-\\u9fa5（）()\d]{1,30}$/" checktips="投保人村输入有误" maxlength="10" onblur="changeposdetailText(this);"></div>');
 							//$(this).parent().next().after('<div class="mui-input-row townn townn_div_class" name="dtown"><label><span></span></label><input type="text" placeholder="请录入镇" class="mui-text-right" data-value="town" id="town" name="town"  checkrul="/^[\\u4e00-\\u9fa5（）()]{1,30}$|^[\\dA-Za-z（）()]{10,}$|^[\\dA-Za-z\\u4e00-\\u9fa5（）()]{1,25}$|^[A-Za-z\\u4e00-\\u9fa5（）()\\d]{1,30}$/" checktips="投保人镇输入有误" maxlength="10" onblur="changeposdetailText(this);"></div>');
 							var town=$("#tbrinfo").find("input[name='town']").val();
 							var countryside=$("#tbrinfo").find("input[name='countryside']").val();
 							$(this).parent().parent().find("input[name='town']").val(town);
 							$(this).parent().parent().find("input[name='countryside']").val(countryside);
 						}else{
 							$(this).parent().parent().find("div[name='dtown']").remove();
 							$(this).parent().parent().find("div[name='dcountryside']").remove();
 						}
 						/* $("#bbrloc").addClass("active");
 						$("#bbrloc").attr("value",tbrpostval);
 						$("#bbrloc").text(tbrposition);
 						$("#bbrposdetail").val(tbrposdetail);
 						$("#bbrzipcode").val($("#tbrzipcode").val()) */
 						$(this).parents("form.ssyinfo").find("div[id='syrloc']").addClass("active");
 						$(this).parents("form.ssyinfo").find("div[id='syrloc']").attr("value",tbrpostval);
 						$(this).parents("form.ssyinfo").find("div[id='syrloc']").text(tbrposition);
 						$(this).parents("form.ssyinfo").find("input[id='syrposdetail']").val(tbrposdetail);
 						//$(this).parents("form.ssyinfo").find("div[id='syrloc']").addClass("active");
 	 	 			}
 	 			}else{
 	 				var bbrpostval=$("#bbrloc").attr("value");
 	 	 			var bbrposition=$("#bbrloc").text();
 	 	 			var bbrposdetail=$("#bbrposdetail").val();

 	 	 			if(bbrposdetail=="" || bbrposdetail == null){
 	 	 				$(this).prop("checked",false);
 	 	 				mui.alert('请填写被保人联系地址');
 	 	 				return false;
 	 	 			}else{
 	 	 				/* $(this).parents("form.ssyinfo").find("div[name='position']").addClass("active");
 	 	 				$(this).parents("form.ssyinfo").find("div[name='position']").attr("value",bbrpostval);
 	 	 				$(this).parents("form.ssyinfo").find("div[name='position']").text(bbrposition);
 	 	 				$(this).parents("form.ssyinfo").find("input[name='posdetail']").val(bbrposdetail); */
 	 	 				if(bbrposition.indexOf("浙江省") != -1){
 							$(this).parent().parent().find("div[name='dtown']").remove();
 							$(this).parent().parent().find("div[name='dcountryside']").remove();
 							//$(this).parent().next().after('<div class="mui-input-row country country_div_class" name="dcountryside"><label><span></span></label><input type="text" placeholder="请录入村" class="mui-text-right" data-value="countryside" id="countryside" name="countryside"  checkrul="/^[\\u4e00-\\u9fa5（）()]{1,30}$|^[\\dA-Za-z（）()]{10,}$|^[\\dA-Za-z\\u4e00-\\u9fa5（）()]{1,25}$|^[A-Za-z\\u4e00-\\u9fa5（）()\d]{1,30}$/" checktips="投保人村输入有误" maxlength="10" onblur="changeposdetailText(this);"></div>');
 							//$(this).parent().next().after('<div class="mui-input-row townn townn_div_class" name="dtown"><label><span></span></label><input type="text" placeholder="请录入镇" class="mui-text-right" data-value="town" id="town" name="town"  checkrul="/^[\\u4e00-\\u9fa5（）()]{1,30}$|^[\\dA-Za-z（）()]{10,}$|^[\\dA-Za-z\\u4e00-\\u9fa5（）()]{1,25}$|^[A-Za-z\\u4e00-\\u9fa5（）()\\d]{1,30}$/" checktips="投保人镇输入有误" maxlength="10" onblur="changeposdetailText(this);"></div>');
 							var town=$("#mbbrinfo").find("input[name='town']").val();
 							var countryside=$("#mbbrinfo").find("input[name='countryside']").val();
 							$(this).parent().parent().find("input[name='town']").val(town);
 							$(this).parent().parent().find("input[name='countryside']").val(countryside);
 						}else{
 							$(this).parent().parent().find("div[name='dtown']").remove();
 							$(this).parent().parent().find("div[name='dcountryside']").remove();
 						}
 						/* $("#bbrloc").addClass("active");
 						$("#bbrloc").attr("value",tbrpostval);
 						$("#bbrloc").text(tbrposition);
 						$("#bbrposdetail").val(tbrposdetail);
 						$("#bbrzipcode").val($("#tbrzipcode").val()) */
 						$(this).parents("form.ssyinfo").find("div[id='syrloc']").addClass("active");
 						$(this).parents("form.ssyinfo").find("div[id='syrloc']").attr("value",bbrpostval);
 						$(this).parents("form.ssyinfo").find("div[id='syrloc']").text(bbrposition);
 						$(this).parents("form.ssyinfo").find("input[id='syrposdetail']").val(bbrposdetail);
 						//$(this).parents("form.ssyinfo").find("div[id='syrloc']").addClass("active");
 	 	 			}
 	 			}
 	    	}
 	    	if($(this).prop("checked")==false){
 	    		$(this).parents("form.ssyinfo").find("div[name='position']").removeClass("active");
	 			$(this).parents("form.ssyinfo").find("div[name='position']").attr("value","");
	 			$(this).parents("form.ssyinfo").find("div[name='position']").text("请选择省市");
	 			$(this).parents("form.ssyinfo").find("input[name='posdetail']").val("");
	 			$(this).parents("form.ssyinfo").find("div[name='dtown']").remove();
				$(this).parents("form.ssyinfo").find("div[name='dcountryside']").remove();
 	    	}
	    });

 	//按比例
	  	$('input[name="syrratio"]').on('click', function() {
	  		$(this).parents("form.ssyinfo").find("input[name='earningRatio']").val("");
	  		var syrratioFlag = $('input:checkbox[name="syrratio"]:checked').val();
	  		/* if(syrratioFlag == "on"){
	  			$('div[id="syposition"]').parent().css("display","none");
	  			$('input:checkbox[name="syrsynposition"]:checked').attr("checked",false)
	  			$(this).parents("form.ssyinfo").siblings().find('input:checkbox[id="syrratio"]:checked').attr("checked",true)
	  		}else if(syrratioFlag == ""){
	  			$('div[id="syposition"]').parent().css("display","none");
	  			$('input:checkbox[name="syrsynposition"]:checked').attr("checked",false)
	  			$(this).parents("form.ssyinfo").siblings().find('input:checkbox[id="syrratio"]:checked').attr("checked",true)
	  		}else if(syrratioFlag == "B"){
	  			$('div[id="syposition"]').parent().css("display","none");
	  			$('input:checkbox[name="syrsynposition"]:checked').attr("checked",false)
	  			$(this).parents("form.ssyinfo").siblings().find('input:checkbox[id="syrratio"]:checked').attr("checked",true)
	  		} */
	  		$('div[id="syposition"]').parent().css("display","none");
	  		$('input:checkbox[name="syrsynposition"]:checked').attr("checked",false);
	  		$('input:checkbox[id="syrratio"]:checked').attr("checked",true)

	  	});

	  	//按顺位
	  	$('input[name="syrsynposition"]').on('click', function() {
	  		//点击按顺位时,显示受益顺位
	  		$('div[id="syposition"]').parent().css("display","block");
	  		//点击按顺位时,默认受益比例为100%
	  		$(this).parents("form.ssyinfo").find("input[name='earningRatio']").val("100");
	  		//点击顺位按钮时,所有顺位按钮皆被选中
	  		//$('input[name="syrsynposition"]:checked').attr("checked",true);
	  		//sjx 2020-01-14防止用户在点击添加受益人时没有选择按顺位,最后点击按顺位的时候受益顺位显示不准确
	  		var tbsLength = $('.mui-input-group').length;
			//受益人顺位 先添加父元素
			$(".ssyinfo").wrapAll("<span></span>");
	  		var ssyinfoIndex = $(this).parents('.ssyinfo').index();
	  		if(ssyinfoIndex == 0){
	  			$(this).parents("form.ssyinfo").find("div[name='positionnum']").text("第一顺位");
	  			$(this).parents("form.ssyinfo").find('div[name="positionnum"]').attr("value","01")
				$(this).parents("form.ssyinfo").find('div[name="positionnum"]').attr("selectdata",'[{"text":"第一顺位","value":"01"}]');
	  		}else if(ssyinfoIndex == 1){
	  			$(this).parents("form.ssyinfo").find("div[name='positionnum']").text("第二顺位");
	  			$(this).parents("form.ssyinfo").find('div[name="positionnum"]').attr("value","02")
				$(this).parents("form.ssyinfo").find('div[name="positionnum"]').attr("selectdata",'[{"text":"第二顺位","value":"02"}]');
	  		}else if(ssyinfoIndex == 2){
	  			$(this).parents("form.ssyinfo").find("div[name='positionnum']").text("第三顺位");
	  			$(this).parents("form.ssyinfo").find('div[name="positionnum"]').attr("value","03")
				$(this).parents("form.ssyinfo").find('div[name="positionnum"]').attr("selectdata",'[{"text":"第三顺位","value":"03"}]');
	  		}
			//删除添加的父元素
			$(".ssyinfo").unwrap();
	  		/* var syrsynpositionFlag = $('input:checkbox[name="syrsynposition"]:checked').val();
	  		if(syrsynpositionFlag == "on"){
	  			$('input:checkbox[name="syrratio"]:checked').attr("checked",false)
	  		}else if(syrsynpositionFlag == ""){
	  			$('input:checkbox[name="syrratio"]:checked').attr("checked",false)
	  		}else if(syrsynpositionFlag == "B"){
	  			$('input:checkbox[name="syrratio"]:checked').attr("checked",false)
	  		}else if(syrsynpositionFlag == "S"){
	  			$('input:checkbox[name="syrratio"]:checked').attr("checked",false)
	  		}else if(syrsynpositionFlag == null){
	  			$('div[id="syposition"]').parent().css("display","none");
	  			$(this).parents("form.ssyinfo").find("input[name='earningRatio']").val("");
	  		} */

	  		/* var syrratiovar = $(this).find('input[name="syrsynposition"]').prop("checked");
	  		if(syrratiovar == true){
	  			$('input:checkbox[name="syrratio"]:checked').attr("checked",false);
	  		} */
	  		$('input:checkbox[name="syrratio"]:checked').attr("checked",false);
	  	});

 	});
 	//end
	//2023-PRD-0011_长生彩虹桥尊享医疗保险B款 不展示受益人
	$(document).ready(function(){
		if("100038" === proCode || "100044" === proCode){
			$("#ssyinfo").hide();
		}
	});

	</script>
</html>
